【发布时间】:2016-10-22 05:52:07
【问题描述】:
我有 ObservableCollection AllRem
public sealed class GetRem
{
public static string RemIDForNot;
public string ReminderColor = "1";
public int RemID { get; set; }
public string ReminderName { get; set; }
public string ReminderDescription { get; set; }
public DateTime ReminderDataTime { get; set; }
public Boolean? ReminderDone = false;
...
}
我需要按 ReminderDateTime 对我的收藏进行排序。我尝试使用 :IComparable 但它不起作用。
【问题讨论】:
-
你试过 linq -
var sortedCollection = yourCollection.OrderBy(x => x.ReminderDateTime)? -
不会返回可观察的集合
-
按照 Romasz 的建议进行操作,然后将其转换为可观察的集合 stackoverflow.com/questions/731626/…