Skip to content

Instantly share code, notes, and snippets.

@wtuts
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wtuts/961c55e5ea4841dc7c82 to your computer and use it in GitHub Desktop.
Save wtuts/961c55e5ea4841dc7c82 to your computer and use it in GitHub Desktop.
Data binding in a list box
<ListBox x:Name="mylistbox">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Height="52" Width="auto">
<TextBlock x:Name="nameblock" Text="{Binding name}" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Height="41" Width="331" FontSize="30" Margin="10,0,0,0" />
<TextBlock x:Name="marksblock" Text="{Binding marks}" HorizontalAlignment="Left" Margin="391,0,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="41" Width="55" FontSize="30" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment