Skip to content

Commit 28e483f

Browse files
Removed tabtitle ans spaces
1 parent e07edbe commit 28e483f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

MAUI/TreeView/sorting.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,18 @@ Custom sorting can be applied by assigning a comparer to the `SortDescriptor.Com
9090
{% tabs %}
9191
{% highlight c# tabtitle="CustomSortComaparer.cs" %}
9292

93-
public class CustomDateSortComparer : IComparer<object>
93+
public class CustomDateSortComparer : IComparer<object>
94+
{
95+
public int Compare(object x, object y)
9496
{
95-
public int Compare(object x, object y)
97+
if (x is FileManager xFile && y is FileManager yFile)
9698
{
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);
103101
}
102+
return 0;
104103
}
104+
}
105105

106106
{% endhighlight %}
107107
{% endtabs %}
@@ -111,7 +111,7 @@ Custom sorting can be applied by assigning a comparer to the `SortDescriptor.Com
111111
When the `SortDescriptors` collection is cleared, it restores the default order of the node collection, and the TreeView reverts to its original order.
112112

113113
{% tabs %}
114-
{% highlight c# tabtitle="MainPage.xaml.cs" %}
114+
{% highlight c# %}
115115
treeView.SortDescriptors.Clear();
116116
{% endhighlight %}
117117
{% endtabs %}

0 commit comments

Comments
 (0)