Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 不符合1)和2)的所有其他项目按其标签字母顺序排序。例如;item0:tag=“苹果”;第1项:标记=“小时”;项2:tag=“event”…string variable=“event”。。。最终订单:项目2、项目0、项目1 EDIT: providin_C#_Wpf_Xaml - Fatal编程技术网

C# 不符合1)和2)的所有其他项目按其标签字母顺序排序。例如;item0:tag=“苹果”;第1项:标记=“小时”;项2:tag=“event”…string variable=“event”。。。最终订单:项目2、项目0、项目1 EDIT: providin

C# 不符合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 =

不符合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 = "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);