Windows Desktop Runtime 8.0 11 [upd] May 2026
<Window x:Class="Win11AcrylicFeature.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Title="Windows 11 Acrylic Demo" Height="450" Width="600" Background="Transparent" AllowsTransparency="True" WindowStyle="None"> <Grid> <Border x:Name="AcrylicBorder" Background="White" Opacity="0.85"> <Border.Background> <SolidColorBrush Color="#CCFFFFFF"/> </Border.Background> </Border> <StackPanel Margin="20"> <CheckBox x:Name="AcrylicToggle" Content="Enable Acrylic (Windows 11)" Checked="ToggleAcrylic" Unchecked="ToggleAcrylic"/> <TextBlock Text="This window uses dark mode title bar and optional acrylic blur." TextWrapping="Wrap" Margin="0,20"/> </StackPanel> </Grid> </Window>
<PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net8.0-windows10.0.17763.0</TargetFramework> <UseWPF>true</UseWPF> <UseWindowsForms>false</UseWindowsForms> <SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion> </PropertyGroup> Create a helper class Win11ThemeHelper.cs :
private static bool IsSystemDarkMode() { try { using var key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"); return key?.GetValue("AppsUseLightTheme") is int val && val == 0; } catch { return false; } } } MainWindow.xaml windows desktop runtime 8.0 11
[DllImport("dwmapi.dll")] private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref bool value, int size);
private void ApplyAcrylicIfSupported() { if (IsWindows11OrNewer()) { var acrylicBrush = new SolidColorBrush(Color.FromArgb(180, 32, 32, 32)); AcrylicBorder.Background = acrylicBrush; // Real acrylic requires WinUI or custom composition – for demo we use semi-transparent. } } <Window x:Class="Win11AcrylicFeature
using System; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Interop; public static class Win11ThemeHelper { public static void ApplyDarkTitleBar(Window window) { var handle = new WindowInteropHelper(window).EnsureHandle(); var attribute = 20; // DWMWA_USE_IMMERSIVE_DARK_MODE bool useDarkMode = IsSystemDarkMode(); DwmSetWindowAttribute(handle, attribute, ref useDarkMode, Marshal.SizeOf(useDarkMode)); }
It sounds like you want to develop a feature for an app that runs on using .NET 8.0 (the runtime version) and is intended for Windows 11 (or Windows 10/11 with modern APIs). } catch { return false
private void ToggleAcrylic(object sender, RoutedEventArgs e) { if (AcrylicToggle.IsChecked == true) Background = new SolidColorBrush(Color.FromArgb(200, 0, 0, 0)); else Background = new SolidColorBrush(Colors.White); }
