My purpose is to show a collection of items in reverse order in LongListSelector
. I don't want to reverse the collection in code behind using a Reverse()
method (because newly added items won't show correctly...? )
But it seems I should use CollectionViewSource
. the problem is: how to use it?!
<phone:LongListSelector>
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding BookTitle}" FontSize="{StaticResource PhoneFontSizeMedium}"/>
<TextBlock Text="{Binding BookAuthor}" FontSize="{StaticResource PhoneFontSizeMedium}"/>
</StackPanel>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
Is it possible?
you can implement code from the ItemSource property of the control LongListSelector and add the method Reverse () after the sample collection
LongListSelector.ItemSource tuaCollection.Reverse = ();