From 3cf580e541a80506bfa3f7724a44d5bc596e1b40 Mon Sep 17 00:00:00 2001 From: Kenny Guo Date: Mon, 26 Jul 2021 21:06:49 +0800 Subject: [PATCH] Disable Mica before close the window to resolve a crash --- src/Calculator/App.xaml.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Calculator/App.xaml.cs b/src/Calculator/App.xaml.cs index a4586952..21702b66 100644 --- a/src/Calculator/App.xaml.cs +++ b/src/Calculator/App.xaml.cs @@ -440,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(() => {