From 0e3766c3ca6edb62f147641df6bff9757fdf43ce Mon Sep 17 00:00:00 2001 From: United600 Date: Wed, 12 Feb 2025 18:48:22 +0000 Subject: [PATCH] remove mica background on Windows 10 --- Screenbox/Pages/MainPage.xaml | 2 +- Screenbox/Pages/MainPage.xaml.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Screenbox/Pages/MainPage.xaml b/Screenbox/Pages/MainPage.xaml index d76bec29a..f34272b31 100644 --- a/Screenbox/Pages/MainPage.xaml +++ b/Screenbox/Pages/MainPage.xaml @@ -15,7 +15,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:strings="using:Screenbox.Strings" - muxc:BackdropMaterial.ApplyToRootOrPageBackground="True" + contract13NotPresent:Background="{ThemeResource SolidBackgroundFillColorBaseBrush}" Loaded="MainPage_Loaded" mc:Ignorable="d"> diff --git a/Screenbox/Pages/MainPage.xaml.cs b/Screenbox/Pages/MainPage.xaml.cs index ecbf981d1..adffff877 100644 --- a/Screenbox/Pages/MainPage.xaml.cs +++ b/Screenbox/Pages/MainPage.xaml.cs @@ -43,6 +43,12 @@ public MainPage() CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar; coreTitleBar.ExtendViewIntoTitleBar = true; + // Enable mica background on Windows 11 + if (Windows.Foundation.Metadata.ApiInformation.IsMethodPresent("Windows.UI.Composition.Compositor", "TryCreateBlurredWallpaperBackdropBrush")) + { + muxc.BackdropMaterial.SetApplyToRootOrPageBackground(this, true); + } + LeftPaddingColumn.Width = new GridLength(coreTitleBar.SystemOverlayLeftInset); RightPaddingColumn.Width = new GridLength(coreTitleBar.SystemOverlayRightInset);