Skip to content

Commit

Permalink
fix item repeater page crash
Browse files Browse the repository at this point in the history
  • Loading branch information
emmauss committed Feb 16, 2022
1 parent 76cd438 commit ef5851f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ef5851f

Please sign in to comment.