From dbca1b04b07dd5874d66abae4df64cc24ef53051 Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Mon, 24 Jun 2024 17:13:37 +0200 Subject: [PATCH] fix: Avoid infinite layout loop in MediaTransportControls 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 --- .../Controls/MediaPlayerElement/MediaTransportControls.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Uno.UI/UI/Xaml/Controls/MediaPlayerElement/MediaTransportControls.cs b/src/Uno.UI/UI/Xaml/Controls/MediaPlayerElement/MediaTransportControls.cs index b7fd30d4ab62..f722ad4a1c2c 100644 --- a/src/Uno.UI/UI/Xaml/Controls/MediaPlayerElement/MediaTransportControls.cs +++ b/src/Uno.UI/UI/Xaml/Controls/MediaPlayerElement/MediaTransportControls.cs @@ -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; } @@ -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();