C# 不符合1)和2)的所有其他项目按其标签字母顺序排序。例如;item0:tag=“苹果”;第1项:标记=“小时”;项2:tag=“event”…string variable=“event”。。。最终订单:项目2、项目0、项目1 EDIT: providin
不符合1)和2)的所有其他项目按其标签字母顺序排序。例如;item0:tag=“苹果”;第1项:标记=“小时”;项2:tag=“event”…string variable=“event”。。。最终订单:项目2、项目0、项目1C# 不符合1)和2)的所有其他项目按其标签字母顺序排序。例如;item0:tag=“苹果”;第1项:标记=“小时”;项2:tag=“event”…string variable=“event”。。。最终订单:项目2、项目0、项目1 EDIT: providin,c#,wpf,xaml,C#,Wpf,Xaml,不符合1)和2)的所有其他项目按其标签字母顺序排序。例如;item0:tag=“苹果”;第1项:标记=“小时”;项2:tag=“event”…string variable=“event”。。。最终订单:项目2、项目0、项目1 EDIT: providing example for clarification: item0: tag = "apple", isChecked = false; item1: tag = "apple", isChecked = true; item2: tag =
EDIT: providing example for clarification:
item0: tag = "apple", isChecked = false;
item1: tag = "apple", isChecked = true;
item2: tag = "pineapple", isChecked = false;
item3: tag = "coconut", isChecked = true;
item4: tag = "cherry", isChecked = false;
string is: "cherry"
outcome: item1, item3, item4, item0, item2
// Retrieve an IQueryable for the colleciton with your specified conditions
var query = from c in collection
orderby c.IsChecked descending, c.Tag.Equals("cherry") descending, c.obsTag
select c;
// Clear the collection
collection = new ObservableCollection<myCollectionObject>();
// Replace the collection with your IQueryable results
foreach(myCollectionObject obj in query) {
collection.Add(obj);
}
collection = new ObservableCollection<obsCol>(from c in collection
orderby c.obsCheck descending, c.obsTag.Equals("cherry") descending, c.obsTag
select c);