Skip to content

Commit b7cfc2d

Browse files
Merge pull request #57 from unoplatform/dev/xygu/50/defer-load-strat-lazy-nre
fixed NRE when using search-box
2 parents 4908b82 + dd0ebae commit b7cfc2d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Microsoft.Toolkit.Uwp.SampleApp.Shared/Shell.SamplePicker.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ private void HideSamplePicker()
6767

6868
private async void ShowSamplePicker(Sample[] samples = null, bool group = false)
6969
{
70+
// force materialization
71+
FindName("SamplePickerGrid");
72+
7073
if (samples == null && _currentSample != null)
7174
{
7275
var category = await Samples.GetCategoryBySample(_currentSample);
@@ -127,6 +130,7 @@ private void NavView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sende
127130
private void NavView_ItemInvoked(Windows.UI.Xaml.Controls.NavigationView sender, Windows.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args)
128131
#endif
129132
{
133+
// force materialization
130134
FindName("SamplePickerGrid");
131135

132136
if (args.InvokedItem is SampleCategory category)

0 commit comments

Comments
 (0)