Permalink
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (47 sloc) 1.59 KB
<!-- <Snippet1> -->
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:SDKSample"
Width="400" Height="180"
Title="Master-Detail Binding"
Background="Silver">
<!--<SnippetDataContextProperty>-->
<Window.Resources>
<src:LeagueList x:Key="MyList" />
<!--</SnippetDataContextProperty>-->
<Style TargetType="StackPanel">
<Setter Property="DockPanel.Dock" Value="Left"/>
<Setter Property="Margin" Value="10,0,10,0"/>
</Style>
<Style TargetType="ListBox">
<Setter Property="Height" Value="100"/>
</Style>
<Style TargetType="Label">
<Setter Property="FontSize" Value="12"/>
</Style>
<!--<SnippetDataContextProperty2>-->
</Window.Resources>
<!--</SnippetDataContextProperty2>-->
<!--<SnippetDataContextProperty3>-->
<DockPanel DataContext="{Binding Source={StaticResource MyList}}">
<!--</SnippetDataContextProperty3>-->
<StackPanel>
<Label>My Soccer Leagues</Label>
<!--<SnippetEmptyBinding>-->
<ListBox ItemsSource="{Binding}"
IsSynchronizedWithCurrentItem="true"/>
<!--</SnippetEmptyBinding>-->
</StackPanel>
<StackPanel>
<Label Content="{Binding Path=Name}"/>
<ListBox ItemsSource="{Binding Path=Divisions}"
IsSynchronizedWithCurrentItem="true"/>
</StackPanel>
<StackPanel>
<Label Content="{Binding Path=Divisions/Name}"/>
<ListBox ItemsSource="{Binding Path=Divisions/Teams}"/>
</StackPanel>
</DockPanel>
</Window>
<!-- </Snippet1> -->