은 내가 누구의 ItemsSource 전망 (된 UserControls) 루트 A 원소 TabItem의으로 가지고있는 각각의 관찰 컬렉션에 바인딩 된 을 TabControl 있어요. 이 표시 될 때 래퍼가 충돌을 일으키는 의 UserControl 것처럼 그러나 헤더 텍스트는 각 TabItem의 내용이다 :XAML TabControl의 탭 콘텐츠 영역에 탭 머리글이 표시되는 이유는 무엇입니까?
alt text http://i31.tinypic.com/2z7pctz.png
을 TabControl은 SmartFormView.xaml에 있습니다
<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이 표시되도록 변경해야하는 항목은 무엇입니까? 내가 만들고 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>
그리고는 다음과 같습니다 : 여기
는 SmartFormAreaView.xaml라는 TabItem의 전망이다
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);
}