Skip to content

Commit

Permalink
fix: Avoid infinite layout loop in MediaTransportControls
Browse files Browse the repository at this point in the history
Subscription to LayoutUpdated caused it to loop infinitely as it manipulated margins of inner controls, which then triggered another layout loop, which reset them again
  • Loading branch information
MartinZikmund committed Sep 5, 2024
1 parent 6da1754 commit dbca1b0
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ private void OnCommandBarLoaded(object? sender, RoutedEventArgs e)
if (m_tpCommandBar is not null)
{
m_tpCommandBar.Loaded -= OnCommandBarLoaded;
this.LayoutUpdated += MediaTransportControls_LayoutUpdated;
m_tpCommandBar.SizeChanged += Container_SizeChanged;
m_tpCommandBar.DynamicOverflowItemsChanging += M_tpCommandBar_DynamicOverflowItemsChanging;
}
Expand All @@ -551,10 +550,6 @@ private void OnCommandBarLoaded(object? sender, RoutedEventArgs e)
HideCastButtonIfNecessary();
}

private void MediaTransportControls_LayoutUpdated(object? sender, object e)
{
SetMeasureCommandBar();
}
private void M_tpCommandBar_DynamicOverflowItemsChanging(CommandBar sender, DynamicOverflowItemsChangingEventArgs args)
{
SetMeasureCommandBar();
Expand Down

0 comments on commit dbca1b0

Please sign in to comment.