相关文章推荐
睿智的弓箭  ·  python ...·  4 月前    · 
千杯不醉的海龟  ·  Nestjs学习总结 - 知乎·  10 月前    · 
< CollectionViewSource x:Uid =" CollectionViewSource_1" x:Key =' sortedList' Source =" {Binding Path=MyList}" > < CollectionViewSource.SortDe script ions > < scm:SortDe script ion x:Uid =" scm:SortDescription_1" PropertyName =" ID" Direction =" Ascending" / > < /CollectionViewSource.SortDe script ions > < /CollectionViewSource >
and the above collection resource is bounded to listview as below
< ListView x:Uid =" myistBox" Name =" myListBox" ItemsSource =" {Binding Source={StaticResource sortedList}}" SelectedItem =" {Binding SelectedItem, Mode=TwoWay}" Margin =" 5,10,5,5" Grid.Row =" 1" extenders:ListViewExtenders.AutoScrollToEnd =" True" SelectionMode =" Single" > < ListView.View > < GridView x:Uid =" GridView_1" > < GridViewColumn x:Uid =" GridViewColumn_1" DisplayMemberBinding =" {Binding Path=ID}" Header =" ID" / > < GridViewColumn x:Uid =" GridViewColumn_2" DisplayMemberBinding =" {Binding Path=Name}" Header =" Name" / > < /GridView > < /ListView.View > < /ListView > xmlns:s= " clr-namespace:System;assembly=mscorlib" xmlns:scm= " clr-namespace:System.ComponentModel;assembly=WindowsBase" <CollectionViewSource x:Key= " ChannelsToAddView" x:Name= " ChannelsToAddView" Source= " {Binding DiscordChannels}" Filter= " ChannelsToAddView_Filter" IsLiveSortingRequested= " True" > <CollectionViewSource.SortDescriptions> <scm:SortDescription PropertyName= " DiscordChannelName" /> </ CollectionViewSource.SortDescriptions > <CollectionViewSource.LiveSortingProperties> <s:String>DiscordChannelName </ s:String > </ CollectionViewSource.LiveSortingProperties > </ CollectionViewSource >
  • Read the question carefully.
  • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
  •