Skip to content

Commit

Permalink
fix(listview): header losing datacontext on ios between frame navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoy312 committed Nov 28, 2023
1 parent 5e3a9e6 commit 14689be
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBase.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,20 @@ private protected override void Refresh()
InvalidateMeasure();
}
}

public override void MovedToWindow()
{
base.MovedToWindow();

// Uno#13172: The header container can sometimes lose its data-context between/after frame navigation,
// especially so when the header has been scrolled out of viewport (far enough to be recycled) once.
if (Window is { })
{
if (InternalItemsPanelRoot is NativeListViewBase panel)
{
panel.UpdateHeaderAndFooter();
}
}
}
}
}

0 comments on commit 14689be

Please sign in to comment.