私は、そのビューのItemsSourceそのルート要素のTabItemとして持つ(ユーザーコントロール)各観察可能なコレクションにバインドされているTabControlのを持っています。XAML TabControlのタブのコンテンツ領域にタブヘッダーが表示されるのはなぜですか?
alt text http://i31.tinypic.com/2z7pctz.png
タブコントロールがSmartFormView.xamlである:
それが表示されるときユーザーコントロールラッパーが競合を引き起こしているかのようしかし、ヘッダテキストは、それぞれのTabItemのコンテンツであります<UserControl x:Class="TestApp.Views.SmartFormView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel
Margin="10">
<TextBlock Text="{Binding Title}"
FontSize="18"/>
<TextBlock Text="{Binding Description}"
FontSize="12"/>
<TabControl
Margin="0 10 0 0"
ItemsSource="{Binding SmartFormAreaViews}"/>
</StackPanel>
</UserControl>
TabControlの内部にTabItemが表示されるように変更する必要があるのは何ですか?ここで
はSmartFormAreaView.xamlと呼ばれるのTabItem図である:私は作成してのObservableCollectionに各ビューをロードどこ
<UserControl x:Class="TestApp.Views.SmartFormAreaView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TabItem Header="This is the header">
<StackPanel Margin="10">
<TextBlock Text="this is the content"/>
</StackPanel>
</TabItem>
</UserControl>
そして、ここでは、次のとおりです。
var areas = from area in xmlDoc.Descendants("area")
select area;
foreach (var area in areas)
{
SmartFormArea smartFormArea = new SmartFormArea();
smartFormArea.IdCode = area.Attribute("idCode").Value;
smartFormArea.Title = area.Attribute("title").Value;
SmartFormAreaPresenter smartFormAreaPresenter = new SmartFormAreaPresenter(smartFormArea);
SmartFormAreaViews.Add(smartFormAreaPresenter.View as SmartFormAreaView);
}