From 3598ed64abaa6bf10717e449748108be8a6877a0 Mon Sep 17 00:00:00 2001 From: hanzhang54 Date: Thu, 22 Jul 2021 15:13:13 +0800 Subject: [PATCH] Fixed the display issue in AOT mode (#1615) * Fixed the display issue in AOT mode * Get the OpenPaneLength from the resource --- src/Calculator/Views/MainPage.xaml | 2 +- src/Calculator/Views/MainPage.xaml.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Calculator/Views/MainPage.xaml b/src/Calculator/Views/MainPage.xaml index 9487f9f0..123d8782 100644 --- a/src/Calculator/Views/MainPage.xaml +++ b/src/Calculator/Views/MainPage.xaml @@ -101,7 +101,7 @@ ItemInvoked="OnNavItemInvoked" Loaded="OnNavLoaded" MenuItemsSource="{x:Bind CreateUIElementsForCategories(Model.Categories), Mode=OneWay}" - OpenPaneLength="{StaticResource SplitViewOpenPaneLength}" + OpenPaneLength="{x:Bind NavigationViewOpenPaneLength(Model.IsAlwaysOnTop), Mode=OneWay}" PaneClosed="OnNavPaneClosed" PaneOpened="OnNavPaneOpened" SelectionChanged="OnNavSelectionChanged" diff --git a/src/Calculator/Views/MainPage.xaml.cs b/src/Calculator/Views/MainPage.xaml.cs index 46886333..201f9426 100644 --- a/src/Calculator/Views/MainPage.xaml.cs +++ b/src/Calculator/Views/MainPage.xaml.cs @@ -604,6 +604,11 @@ namespace CalculatorApp } } + private double NavigationViewOpenPaneLength(bool isAlwaysOnTop) + { + return isAlwaysOnTop ? 0 : (double)Application.Current.Resources["SplitViewOpenPaneLength"]; + } + private CalculatorApp.Calculator m_calculator; private GraphingCalculator m_graphingCalculator; private CalculatorApp.UnitConverter m_converter;