Skip to content

Commit 8ba88f4

Browse files
committed
Fix AOT Crash for LandingPages
1 parent 0ad8dbb commit 8ba88f4

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

dev/DevWinUI.Controls/LandingPages/AllLandingPage.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,23 @@ public void OrderBy(Func<DataItem, object> orderby = null)
109109
{
110110
if (orderby != null)
111111
{
112-
Items = Items?.OrderBy(orderby);
112+
Items = Items?.OrderBy(orderby).ToList();
113113
}
114114
else
115115
{
116-
Items = Items?.OrderBy(i => i.Title);
116+
Items = Items?.OrderBy(i => i.Title).ToList();
117117
}
118118
}
119119

120120
public void OrderByDescending(Func<DataItem, object> orderByDescending = null)
121121
{
122122
if (orderByDescending != null)
123123
{
124-
Items = Items?.OrderByDescending(orderByDescending);
124+
Items = Items?.OrderByDescending(orderByDescending).ToList();
125125
}
126126
else
127127
{
128-
Items = Items?.OrderByDescending(i => i.Title);
128+
Items = Items?.OrderByDescending(i => i.Title).ToList();
129129
}
130130
}
131131
}

dev/DevWinUI.Controls/LandingPages/MainLandingPage.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,23 +193,23 @@ public void OrderBy(Func<DataItem, object> orderby = null)
193193
{
194194
if (orderby != null)
195195
{
196-
Items = Items?.OrderBy(orderby);
196+
Items = Items?.OrderBy(orderby).ToList();
197197
}
198198
else
199199
{
200-
Items = Items?.OrderBy(i => i.Title);
200+
Items = Items?.OrderBy(i => i.Title).ToList();
201201
}
202202
}
203203

204204
public void OrderByDescending(Func<DataItem, object> orderByDescending = null)
205205
{
206206
if (orderByDescending != null)
207207
{
208-
Items = Items?.OrderByDescending(orderByDescending);
208+
Items = Items?.OrderByDescending(orderByDescending).ToList();
209209
}
210210
else
211211
{
212-
Items = Items?.OrderByDescending(i => i.Title);
212+
Items = Items?.OrderByDescending(i => i.Title).ToList();
213213
}
214214
}
215215

0 commit comments

Comments
 (0)