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

This commit is contained in:
Kenny Guo 2021-07-27 11:06:46 +08:00 committed by GitHub
commit 66c2f5915e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -440,6 +440,10 @@ namespace CalculatorApp
mainPage.UnregisterEventHandlers(); 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 frameService.HandleViewRelease();
await Task.Run(() => await Task.Run(() =>
{ {