Fixed the display issue in AOT mode (#1615)

* Fixed the display issue in AOT mode

* Get the OpenPaneLength from the resource
This commit is contained in:
hanzhang54 2021-07-22 15:13:13 +08:00 committed by GitHub
commit 3598ed64ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -101,7 +101,7 @@
ItemInvoked="OnNavItemInvoked" ItemInvoked="OnNavItemInvoked"
Loaded="OnNavLoaded" Loaded="OnNavLoaded"
MenuItemsSource="{x:Bind CreateUIElementsForCategories(Model.Categories), Mode=OneWay}" MenuItemsSource="{x:Bind CreateUIElementsForCategories(Model.Categories), Mode=OneWay}"
OpenPaneLength="{StaticResource SplitViewOpenPaneLength}" OpenPaneLength="{x:Bind NavigationViewOpenPaneLength(Model.IsAlwaysOnTop), Mode=OneWay}"
PaneClosed="OnNavPaneClosed" PaneClosed="OnNavPaneClosed"
PaneOpened="OnNavPaneOpened" PaneOpened="OnNavPaneOpened"
SelectionChanged="OnNavSelectionChanged" SelectionChanged="OnNavSelectionChanged"

View file

@ -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 CalculatorApp.Calculator m_calculator;
private GraphingCalculator m_graphingCalculator; private GraphingCalculator m_graphingCalculator;
private CalculatorApp.UnitConverter m_converter; private CalculatorApp.UnitConverter m_converter;