You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class CustomDateSortComparer : IComparer<object>
93
+
public class CustomDateSortComparer : IComparer<object>
94
+
{
95
+
public int Compare(object x, object y)
94
96
{
95
-
public int Compare(object x, object y)
97
+
if (x is FileManager xFile && y is FileManager yFile)
96
98
{
97
-
if (x is FileManager xFile && y is FileManager yFile)
98
-
{
99
-
// Latest file upadted dates will come first (descending order)
100
-
return -DateTime.Compare(xFile.Date, yFile.Date);
101
-
}
102
-
return 0;
99
+
// Latest file upadted dates will come first (descending order)
100
+
return -DateTime.Compare(xFile.Date, yFile.Date);
103
101
}
102
+
return 0;
104
103
}
104
+
}
105
105
106
106
{% endhighlight %}
107
107
{% endtabs %}
@@ -111,7 +111,7 @@ Custom sorting can be applied by assigning a comparer to the `SortDescriptor.Com
111
111
When the `SortDescriptors` collection is cleared, it restores the default order of the node collection, and the TreeView reverts to its original order.
0 commit comments