Update to WinUI 2.6 (#1618)

* Update to WinUI 2.6

Co-authored-by: Han Zhang <zhangh@microsoft.com>
Co-authored-by: Kenny Guo <kennyguo@microsoft.com>

**Description of the changes:**
1. Update to WinUI 2.6 styles and controls #1606.
2. Add Mica Material #1611.
3. Add Settings page #596.
4. Fix Ctrl+E shortcuts in AoT mode #1590.

**How changes were validated:**
Passed build, UT/UI test and manually tested.

* Fixed the display issue in AOT mode (#1615)

* Fixed the display issue in AOT mode

* Get the OpenPaneLength from the resource

* Fix CalendarView style in DateCalculation of dark mode (#1616)

* Fix a style problem of Date Calculator, and clean some unused codes

* Remove some unused codes

* Disable Mica before close the window to resolve a crash (#1619)

* Bump internal package build number (#1621)
This commit is contained in:
hanzhang54 2021-07-27 17:35:16 +08:00 committed by GitHub
parent 830115633c
commit e06355c9aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 3802 additions and 1919 deletions

View file

@ -124,7 +124,7 @@ namespace CalculatorApp
return frame;
}
private static void SetMinWindowSizeAndActivate(Frame rootFrame, Size minWindowSize)
private static void SetMinWindowSizeAndThemeAndActivate(Frame rootFrame, Size minWindowSize)
{
// SetPreferredMinSize should always be called before Window.Activate
ApplicationView appView = ApplicationView.GetForCurrentView();
@ -132,6 +132,7 @@ namespace CalculatorApp
// Place the frame in the current Window
Window.Current.Content = rootFrame;
CalculatorApp.Utils.ThemeHelper.InitializeAppTheme();
Window.Current.Activate();
}
@ -199,7 +200,7 @@ namespace CalculatorApp
throw new SystemException();
}
SetMinWindowSizeAndActivate(rootFrame, minWindowSize);
SetMinWindowSizeAndThemeAndActivate(rootFrame, minWindowSize);
m_mainViewId = ApplicationView.GetForCurrentView().Id;
AddWindowToMap(WindowFrameService.CreateNewWindowFrameService(rootFrame, false, weak));
}
@ -223,7 +224,7 @@ namespace CalculatorApp
{
var newRootFrame = App.CreateFrame();
SetMinWindowSizeAndActivate(newRootFrame, minWindowSize);
SetMinWindowSizeAndThemeAndActivate(newRootFrame, minWindowSize);
if (!newRootFrame.Navigate(typeof(MainPage), argument))
{
@ -439,6 +440,10 @@ namespace CalculatorApp
mainPage.UnregisterEventHandlers();
// TODO, remove this workaround after Mica fix
// Workaround app crash caused by Mica in multi-view case.
Microsoft.UI.Xaml.Controls.BackdropMaterial.SetApplyToRootOrPageBackground(mainPage, false);
await frameService.HandleViewRelease();
await Task.Run(() =>
{