-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
34 lines (33 loc) · 1.54 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<Window x:Class="TabControlDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:TabControlDemo"
xmlns:vm="clr-namespace:Models2;assembly=Models"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<TabControl ItemsSource="{Binding Details}" SelectedItem="{Binding SelectedEntity}">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Header" Value="{Binding Name}" />
</Style>
</TabControl.ItemContainerStyle>
<TabControl.Resources>
<DataTemplate DataType="{x:Type vm:ContactDetail}">
<local:ContactDetailView />
</DataTemplate>
<DataTemplate DataType="{x:Type vm:Internet}">
<local:InternetView/>
</DataTemplate>
<DataTemplate DataType="{x:Type vm:PhoneNumber}">
<local:PhoneNumberView/>
</DataTemplate>
<DataTemplate DataType="{x:Type vm:Address}">
<local:AddressView/>
</DataTemplate>
</TabControl.Resources>
</TabControl>
</Grid>
</Window>