From 21b3bdc0550cb56caac7e0f41c2761cc20d94be6 Mon Sep 17 00:00:00 2001 From: xiaoy312 Date: Tue, 9 Jun 2020 11:56:08 -0400 Subject: [PATCH] fix(NavigationView): toggle pane button width when light-dismissed --- .../UI/Xaml/Controls/NavigationView/NavigationView.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationView.cs b/src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationView.cs index daa5e5c1b251..3c7bfb2c9142 100644 --- a/src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationView.cs +++ b/src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationView.cs @@ -3034,12 +3034,15 @@ void UpdatePaneToggleSize() if (!m_isClosedCompact && PaneTitle?.Length > 0) { - if (splitView.DisplayMode == SplitViewDisplayMode.Overlay && IsPaneOpen) + // if splitView.IsPaneOpen changed directly by SplitView, + // the two-way binding haven't sync'd up IsPaneOpen yet. + var isPaneOpen = m_isOpenPaneForInteraction ? IsPaneOpen : splitView.IsPaneOpen; + if (splitView.DisplayMode == SplitViewDisplayMode.Overlay && isPaneOpen) { width = OpenPaneLength; togglePaneButtonWidth = OpenPaneLength - (ShouldShowBackButton() ? c_backButtonWidth : 0); } - else if (!(splitView.DisplayMode == SplitViewDisplayMode.Overlay && !IsPaneOpen)) + else if (!(splitView.DisplayMode == SplitViewDisplayMode.Overlay && !isPaneOpen)) { width = OpenPaneLength; togglePaneButtonWidth = OpenPaneLength;