Hi Alex,
in XAML/C# we've also the ItemTemplate-Property. It takes a DataTemplate that lets you define the elements for a single item.
Let's say you've a collection of Person-objects. Each Person has a FirstName and a LastName. Then your ListView with a DataTemplate can look like this:
<ListView ItemsSource="{Binding Persons}">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding FirstName}"/>
<TextBlock Text="{Binding LastName}"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Thomas Claudius Huber
"If you can´t make your app run faster, make it at least look & feel extremly fast"
twitter: @thomasclaudiush
homepage: www.thomasclaudiushuber.com
author of: ultimate Windows Store Apps handbook | ultimate WPF handbook | ultimate Silverlight handbook
No comments:
Post a Comment