Simple Listbox Ordering using a CollectionViewSource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListBox ItemsSource="{Binding List}" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xmlns:cm="clr-namespace:System.ComponentModel;assembly=System.Windows" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CollectionViewSource x:Key="ListViewSource" Source="{Binding List}"> | |
<CollectionViewSource.SortDescriptions> | |
<cm:SortDescription PropertyName="Name" Direction="Ascending" /> | |
</CollectionViewSource.SortDescriptions> | |
</CollectionViewSource> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListBox ItemsSource="{Binding Source={StaticResource ListViewSource}}" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment