From ef5851f123fb8a4b6185352da1a37fe6d1942029 Mon Sep 17 00:00:00 2001 From: Emmanuel Hansen Date: Thu, 3 Feb 2022 20:48:47 +0000 Subject: [PATCH] fix item repeater page crash --- samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs b/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs index 9e898c45369..6f0f8fcde0c 100644 --- a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs @@ -111,7 +111,7 @@ private void LayoutChanged(object sender, SelectionChangedEventArgs e) private void ScrollTo(int index) { System.Diagnostics.Debug.WriteLine("Scroll to " + index); - var layoutManager = ((Window)this.GetVisualRoot()).LayoutManager; + var layoutManager = ((TopLevel)VisualRoot).LayoutManager; var element = _repeater.GetOrCreateElement(index); layoutManager.ExecuteLayoutPass(); element.BringIntoView();