Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| <!--<SnippetSource>--> | |
| <Window x:Class="SDKSample.Window1" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:local="clr-namespace:SDKSample" | |
| Title="Binding to a Collection" | |
| SizeToContent="WidthAndHeight"> | |
| <Window.Resources> | |
| <local:People x:Key="MyFriends"/> | |
| <!--</SnippetSource>--> | |
| <Style TargetType="ListBoxItem"> | |
| <Setter Property="FontFamily" Value="Verdana"/> | |
| <Setter Property="FontSize" Value="11"/> | |
| <Setter Property="Padding" Value="10"/> | |
| </Style> | |
| <!--<SnippetDetailTemplate>--> | |
| <DataTemplate x:Key="DetailTemplate"> | |
| <Border Width="300" Height="100" Margin="20" | |
| BorderBrush="Aqua" BorderThickness="1" Padding="8"> | |
| <Grid> | |
| <Grid.RowDefinitions> | |
| <RowDefinition/> | |
| <RowDefinition/> | |
| <RowDefinition/> | |
| </Grid.RowDefinitions> | |
| <Grid.ColumnDefinitions> | |
| <ColumnDefinition/> | |
| <ColumnDefinition/> | |
| </Grid.ColumnDefinitions> | |
| <TextBlock Grid.Row="0" Grid.Column="0" Text="First Name:"/> | |
| <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=FirstName}"/> | |
| <TextBlock Grid.Row="1" Grid.Column="0" Text="Last Name:"/> | |
| <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=LastName}"/> | |
| <TextBlock Grid.Row="2" Grid.Column="0" Text="Home Town:"/> | |
| <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=HomeTown}"/> | |
| </Grid> | |
| </Border> | |
| </DataTemplate> | |
| <!--</SnippetDetailTemplate>--> | |
| <!--<SnippetUI>--> | |
| </Window.Resources> | |
| <StackPanel> | |
| <TextBlock FontFamily="Verdana" FontSize="11" | |
| Margin="5,15,0,10" FontWeight="Bold">My Friends:</TextBlock> | |
| <ListBox Width="200" IsSynchronizedWithCurrentItem="True" | |
| ItemsSource="{Binding Source={StaticResource MyFriends}}"/> | |
| <TextBlock FontFamily="Verdana" FontSize="11" | |
| Margin="5,15,0,5" FontWeight="Bold">Information:</TextBlock> | |
| <ContentControl Content="{Binding Source={StaticResource MyFriends}}" | |
| ContentTemplate="{StaticResource DetailTemplate}"/> | |
| </StackPanel> | |
| </Window> | |
| <!--</SnippetUI>--> |