diff --git a/FluentWPF/AcrylicContextMenu.cs b/FluentWPF/AcrylicContextMenu.cs index 622b789..c46c7e9 100644 --- a/FluentWPF/AcrylicContextMenu.cs +++ b/FluentWPF/AcrylicContextMenu.cs @@ -59,7 +59,7 @@ protected override void OnOpened(RoutedEventArgs e) base.OnOpened(e); var hwnd = (HwndSource)HwndSource.FromVisual(this); - AcrylicHelper.EnableBlur(hwnd.Handle, AccentFlagsType.Popup); + AcrylicHelper.SetBlur(hwnd.Handle, AccentFlagsType.Popup); } } } diff --git a/FluentWPF/AcrylicPopup.cs b/FluentWPF/AcrylicPopup.cs index 62d0e56..ce1ac02 100644 --- a/FluentWPF/AcrylicPopup.cs +++ b/FluentWPF/AcrylicPopup.cs @@ -60,7 +60,7 @@ protected override void OnOpened(EventArgs e) base.OnOpened(e); var hwnd = (HwndSource)HwndSource.FromVisual(this.Child); - AcrylicHelper.EnableBlur(hwnd.Handle, AccentFlagsType.Popup); + AcrylicHelper.SetBlur(hwnd.Handle, AccentFlagsType.Popup); } } } diff --git a/FluentWPF/AcrylicToolTip.cs b/FluentWPF/AcrylicToolTip.cs index 51ea700..10fa4e3 100644 --- a/FluentWPF/AcrylicToolTip.cs +++ b/FluentWPF/AcrylicToolTip.cs @@ -57,7 +57,7 @@ protected override void OnOpened(RoutedEventArgs e) { base.OnOpened(e); var hwnd = (HwndSource)HwndSource.FromVisual(this); - AcrylicHelper.EnableBlur(hwnd.Handle, AccentFlagsType.Popup); + AcrylicHelper.SetBlur(hwnd.Handle, AccentFlagsType.Popup); } } } diff --git a/FluentWPF/AcrylicWindow.cs b/FluentWPF/AcrylicWindow.cs index 160f2a6..f8f7463 100644 --- a/FluentWPF/AcrylicWindow.cs +++ b/FluentWPF/AcrylicWindow.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; @@ -20,6 +21,16 @@ namespace SourceChord.FluentWPF { + public enum AcrylicAccentState + { + Default = -1, + Disabled = 0, + Gradient = 1, + TransparentGradient = 2, + BlurBehind = 3, + AcrylicBlurBehind = 4, + } + public enum AcrylicWindowStyle { Normal, @@ -72,6 +83,7 @@ static AcrylicWindow() TintOpacityProperty = AcrylicElement.TintOpacityProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(0.6, FrameworkPropertyMetadataOptions.Inherits)); NoiseOpacityProperty = AcrylicElement.NoiseOpacityProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(0.03, FrameworkPropertyMetadataOptions.Inherits)); FallbackColorProperty = AcrylicElement.FallbackColorProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(Colors.LightGray, FrameworkPropertyMetadataOptions.Inherits)); + AcrylicAccentStateProperty = AcrylicElement.AcrylicAccentStateProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(AcrylicAccentState.Default, FrameworkPropertyMetadataOptions.Inherits)); ExtendViewIntoTitleBarProperty = AcrylicElement.ExtendViewIntoTitleBarProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits)); AcrylicWindowStyleProperty = AcrylicElement.AcrylicWindowStyleProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(AcrylicWindowStyle.Normal, FrameworkPropertyMetadataOptions.Inherits)); TitleBarProperty = AcrylicElement.TitleBarProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits)); @@ -94,32 +106,289 @@ public override void OnApplyTemplate() } } + private static readonly int WM_SIZE = 0x0005; + private static readonly int WM_WINDOWPOSCHANGING = 0x0046; + private static readonly int WM_SYSCOMMAND = 0x112; + + private static readonly int WM_ENTERSIZEMOVE = 0x0231; + private static readonly int WM_EXITSIZEMOVE = 0x0232; + private static readonly int WM_GETMINMAXINFO = 0x0024; + [DllImport("user32.dll")] + static extern bool InvalidateRect(IntPtr hWnd, IntPtr lpRect, bool bErase); + + [DllImport("user32.dll")] + public static extern IntPtr MonitorFromWindow(IntPtr hwnd, int dwFlags); + + [DllImport("user32.dll")] + public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi); + + [DllImport("shcore.dll")] + public static extern int GetDpiForMonitor(IntPtr hMonitor, int dpiType, out uint dpiX, out uint dpiY); + + [DllImport("user32.dll", SetLastError = true)] + internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); + + + [StructLayout(LayoutKind.Sequential)] + public struct MONITORINFO + { + public int cbSize; + public RECT rcMonitor; + public RECT rcWork; + public int dwFlags; + } + + [StructLayout(LayoutKind.Sequential)] + public struct RECT + { + public int left; + public int top; + public int right; + public int bottom; + } + + private struct POINT + { + public int x; + public int y; + } + + [StructLayout(LayoutKind.Sequential)] + private struct MINMAXINFO + { + public POINT ptReserved; + public POINT ptMaxSize; + public POINT ptMaxPosition; + public POINT ptMinTrackSize; + public POINT ptMaxTrackSize; + } + + + [StructLayout(LayoutKind.Sequential)] + public struct WINDOWPOS + { + public IntPtr hwnd; + public IntPtr hwndInsertAfter; + public int x; + public int y; + public int cx; + public int cy; + public uint flags; + } + + private static readonly int MONITOR_DEFAULTTOPRIMARY = 1; + private static readonly int MONITOR_DEFAULTTONEAREST = 2; + + private enum SysCommands : int + { + SC_RESTORE = 0xF120, + } + + private enum SizeEvents : int + { + SIZE_RESTORED = 0, + SIZE_MAXIMIZED = 2, + } + + private enum WindowRestoringState + { + Default, // Restored + Restoring, + } + + private class AcrylicWindowInternalState + { + public WindowRestoringState RestoringState { get; set; } + public CommandBinding CloseCommand { get; set; } + public CommandBinding MinimizeCommand { get; set; } + public CommandBinding MaximizeCommand { get; set; } + public CommandBinding RestoreCommand { get; set; } + } + + private static ConditionalWeakTable _internalStateTable = new ConditionalWeakTable(); + internal static void EnableBlur(Window win) + { + // ウィンドウに半透明のアクリル効果を適用する + var state = AcrylicWindow.GetAcrylicAccentState(win); + SetBlur(win, state); + + if (!_internalStateTable.TryGetValue(win, out var _)) + { + var windowHelper = new WindowInteropHelper(win); + var source = HwndSource.FromHwnd(windowHelper.Handle); + source.AddHook(WndProc); + + // タイトルバーの各種ボタンで利用するコマンドの設定 + var closeBinding = new CommandBinding(SystemCommands.CloseWindowCommand, (_, __) => { SystemCommands.CloseWindow(win); }); + var minimizeBinding = new CommandBinding(SystemCommands.MinimizeWindowCommand, (_, __) => { SystemCommands.MinimizeWindow(win); }); + var maximizeBinding = new CommandBinding(SystemCommands.MaximizeWindowCommand, (_, __) => { SystemCommands.MaximizeWindow(win); }); + var restoreBinding = new CommandBinding(SystemCommands.RestoreWindowCommand, (_, __) => { SystemCommands.RestoreWindow(win); }); + win.CommandBindings.Add(closeBinding); + win.CommandBindings.Add(minimizeBinding); + win.CommandBindings.Add(maximizeBinding); + win.CommandBindings.Add(restoreBinding); + + var internalState = new AcrylicWindowInternalState() + { + RestoringState = WindowRestoringState.Default, + CloseCommand = closeBinding, + MinimizeCommand = minimizeBinding, + MaximizeCommand = maximizeBinding, + RestoreCommand = restoreBinding, + }; + _internalStateTable.Add(win, internalState); + + // WPFのSizeToContentのバグ対策 + // (WindowChrome使用時に、SizeToContentのウィンドウサイズ計算が正しく行われない) + void onContentRendered(object sender, EventArgs e) + { + if (win.SizeToContent != SizeToContent.Manual) + { + win.InvalidateMeasure(); + } + + win.ContentRendered -= onContentRendered; + InvalidateRect(windowHelper.Handle, IntPtr.Zero, true); + } + win.ContentRendered += onContentRendered; + InvalidateRect(windowHelper.Handle, IntPtr.Zero, true); + } + } + + internal static void DisableBlur(Window win) + { + // アクリル効果を解除する + SetBlur(win, AcrylicAccentState.Disabled); + + + if (_internalStateTable.TryGetValue(win, out var internalState)) + { + var windowHelper = new WindowInteropHelper(win); + var source = HwndSource.FromHwnd(windowHelper.Handle); + source.RemoveHook(WndProc); + + // コマンド解除 + win.CommandBindings.Remove(internalState.CloseCommand); + win.CommandBindings.Remove(internalState.MinimizeCommand); + win.CommandBindings.Remove(internalState.MaximizeCommand); + win.CommandBindings.Remove(internalState.RestoreCommand); + + _internalStateTable.Remove(win); + } + } + + internal static void SetBlur(Window win, AcrylicAccentState state, AccentFlagsType style = AccentFlagsType.Window) { var windowHelper = new WindowInteropHelper(win); - // ウィンドウに半透明のアクリル効果を適用する - AcrylicHelper.EnableBlur(windowHelper.Handle); + var value = AcrylicHelper.SelectAccentState(state); + AcrylicHelper.SetBlur(windowHelper.Handle, style, value); + } - // タイトルバーの各種ボタンで利用するコマンドの設定 - win.CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, (_, __) => { SystemCommands.CloseWindow(win); })); - win.CommandBindings.Add(new CommandBinding(SystemCommands.MinimizeWindowCommand, (_, __) => { SystemCommands.MinimizeWindow(win); })); - win.CommandBindings.Add(new CommandBinding(SystemCommands.MaximizeWindowCommand, (_, __) => { SystemCommands.MaximizeWindow(win); })); - win.CommandBindings.Add(new CommandBinding(SystemCommands.RestoreWindowCommand, (_, __) => { SystemCommands.RestoreWindow(win); })); + protected static IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) + { + if (msg == WM_ENTERSIZEMOVE) + { + var win = (Window)HwndSource.FromHwnd(hwnd).RootVisual; + var state = AcrylicWindow.GetAcrylicAccentState(win); + var value = AcrylicHelper.SelectAccentState(state); + if (value == AccentState.ACCENT_ENABLE_ACRYLICBLURBEHIND) + { + AcrylicWindow.SetBlur(win, AcrylicAccentState.BlurBehind); + InvalidateRect(hwnd, IntPtr.Zero, true); + } + } + else if (msg == WM_EXITSIZEMOVE) + { + var win = (Window)HwndSource.FromHwnd(hwnd).RootVisual; + var state = AcrylicWindow.GetAcrylicAccentState(win); + AcrylicWindow.SetBlur(win, state); + InvalidateRect(hwnd, IntPtr.Zero, true); + if (win != null && _internalStateTable.TryGetValue(win, out var internalState)) + { + internalState.RestoringState = WindowRestoringState.Default; + } + } + else if (msg == WM_GETMINMAXINFO) + { + handled = true; + + var hMonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); + var monitorInfo = new MONITORINFO + { + cbSize = Marshal.SizeOf(typeof(MONITORINFO)) + }; - // WPFのSizeToContentのバグ対策 - // (WindowChrome使用時に、SizeToContentのウィンドウサイズ計算が正しく行われない) - void onContentRendered(object sender, EventArgs e) + GetMonitorInfo(hMonitor, ref monitorInfo); + var info = (MINMAXINFO)Marshal.PtrToStructure(lParam, typeof(MINMAXINFO)); + var workingRectangle = monitorInfo.rcWork; + var monitorRectangle = monitorInfo.rcMonitor; + + info.ptMaxPosition.x = Math.Abs(workingRectangle.left - monitorRectangle.left); + info.ptMaxPosition.y = Math.Abs(workingRectangle.top - monitorRectangle.top); + info.ptMaxSize.x = Math.Abs(workingRectangle.right - monitorRectangle.left); + info.ptMaxSize.y = Math.Abs(workingRectangle.bottom - monitorRectangle.top); + Marshal.StructureToPtr(info, lParam, true); + return IntPtr.Zero; + } + else if (msg == WM_SIZE && wParam == (IntPtr)SizeEvents.SIZE_MAXIMIZED) { - if (win.SizeToContent != SizeToContent.Manual) + var win = (Window)HwndSource.FromHwnd(hwnd).RootVisual; + if (win != null && _internalStateTable.TryGetValue(win, out var internalState)) { - win.InvalidateMeasure(); + internalState.RestoringState = WindowRestoringState.Default; } - win.ContentRendered -= onContentRendered; + var hMonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); + var monitorInfo = new MONITORINFO + { + cbSize = Marshal.SizeOf(typeof(MONITORINFO)) + }; + + GetMonitorInfo(hMonitor, ref monitorInfo); + var workingRectangle = monitorInfo.rcWork; + var monitorRectangle = monitorInfo.rcMonitor; + + var x = workingRectangle.left; + var y = workingRectangle.top; + var width = Math.Abs(workingRectangle.right - workingRectangle.left); + var height = Math.Abs(workingRectangle.bottom - workingRectangle.top); + MoveWindow(hwnd, x, y, width, height, true); + } + else if (msg == WM_SIZE && wParam == (IntPtr)SizeEvents.SIZE_RESTORED) + { + var win = (Window)HwndSource.FromHwnd(hwnd).RootVisual; + if (win != null && _internalStateTable.TryGetValue(win, out var internalState)) + { + if (win.WindowState == WindowState.Maximized) { internalState.RestoringState = WindowRestoringState.Restoring; } + } + } + else if (msg == WM_SYSCOMMAND && wParam == (IntPtr)SysCommands.SC_RESTORE) + { + var win = (Window)HwndSource.FromHwnd(hwnd).RootVisual; + if (win != null && _internalStateTable.TryGetValue(win, out var internalState)) + { + internalState.RestoringState = WindowRestoringState.Default; + } + } + else if (msg == WM_WINDOWPOSCHANGING) + { + var win = (Window)HwndSource.FromHwnd(hwnd).RootVisual; + if (win != null && _internalStateTable.TryGetValue(win, out var internalState)) + { + var pos = (WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(WINDOWPOS)); + if (internalState.RestoringState == WindowRestoringState.Restoring && + !(pos.x == 0 && pos.y == 0 && pos.cx == 0 && pos.cy == 0)) + { + pos.y -= 8; + Marshal.StructureToPtr(pos, lParam, true); + } + } } - win.ContentRendered += onContentRendered; + + return IntPtr.Zero; } #region Dependency Property @@ -200,6 +469,17 @@ public static void SetFallbackColor(DependencyObject obj, Color value) obj.SetValue(AcrylicElement.FallbackColorProperty, value); } + // Using a DependencyProperty as the backing store for AcrylicAccentState. This enables animation, styling, binding, etc... + public static readonly DependencyProperty AcrylicAccentStateProperty; + public static AcrylicAccentState GetAcrylicAccentState(DependencyObject obj) + { + return (AcrylicAccentState)obj.GetValue(AcrylicElement.AcrylicAccentStateProperty); + } + + public static void SetAcrylicAccentState(DependencyObject obj, AcrylicAccentState value) + { + obj.SetValue(AcrylicElement.AcrylicAccentStateProperty, value); + } public bool ExtendViewIntoTitleBar { @@ -302,12 +582,26 @@ private static void OnEnableChanged(DependencyObject d, DependencyPropertyChange var value = (bool)e.NewValue; if (value) { - var dic = new ResourceDictionary() { Source = new Uri("pack://application:,,,/FluentWPF;component/Styles/Window.xaml") }; - var style = dic["AcrylicWindowStyle"] as Style; - win.Style = style; + win.SetResourceReference(FrameworkElement.StyleProperty, "AcrylicWindowStyle"); - win.Loaded += (_, __) => { EnableBlur(win); }; - if(win.IsLoaded) EnableBlur(win); + win.Loaded += (_, __) => + { + EnableBlur(win); + var windowHelper = new WindowInteropHelper(win); + InvalidateRect(windowHelper.Handle, IntPtr.Zero, true); + }; + if (win.IsLoaded) + { + EnableBlur(win); + var windowHelper = new WindowInteropHelper(win); + InvalidateRect(windowHelper.Handle, IntPtr.Zero, true); + } + } + else + { + win.Style = null; + win.ClearValue(FrameworkElement.StyleProperty); + DisableBlur(win); } } #endregion @@ -383,6 +677,36 @@ public static void SetFallbackColor(DependencyObject obj, Color value) DependencyProperty.RegisterAttached("FallbackColor", typeof(Color), typeof(AcrylicElement), new FrameworkPropertyMetadata(Colors.LightGray, FrameworkPropertyMetadataOptions.Inherits)); + public static AcrylicAccentState GetAcrylicAccentState(DependencyObject obj) + { + return (AcrylicAccentState)obj.GetValue(AcrylicAccentStateProperty); + } + + public static void SetAcrylicAccentState(DependencyObject obj, AcrylicAccentState value) + { + obj.SetValue(AcrylicAccentStateProperty, value); + } + + // Using a DependencyProperty as the backing store for AcrylicAccentState. This enables animation, styling, binding, etc... + public static readonly DependencyProperty AcrylicAccentStateProperty = + DependencyProperty.RegisterAttached("AcrylicAccentState", typeof(AcrylicAccentState), typeof(AcrylicElement), new FrameworkPropertyMetadata(AcrylicAccentState.Default, FrameworkPropertyMetadataOptions.Inherits, OnAcrylicAccentStateChanged)); + + private static void OnAcrylicAccentStateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + + var win = d as Window; + if (win == null) { return; } + + var isAcrylic = win is AcrylicWindow || AcrylicWindow.GetEnabled(win); + + var newValue = (AcrylicAccentState)e.NewValue; + var oldValue = (AcrylicAccentState)e.OldValue; + if (isAcrylic && newValue != oldValue) + { + AcrylicWindow.SetBlur(win, newValue); + } + } + public static bool GetExtendViewIntoTitleBar(DependencyObject obj) { return (bool)obj.GetValue(ExtendViewIntoTitleBarProperty); diff --git a/FluentWPF/RevealPanel.cs b/FluentWPF/RevealPanel.cs index 29e1288..5f6e2f4 100644 --- a/FluentWPF/RevealPanel.cs +++ b/FluentWPF/RevealPanel.cs @@ -48,7 +48,7 @@ namespace SourceChord.FluentWPF [TemplateVisualState(Name = "MouseOver", GroupName = "CommonStates")] [TemplateVisualState(Name = "Pressed", GroupName = "CommonStates")] [TemplateVisualState(Name = "Disabled", GroupName = "CommonStates")] - public class RevealPanel : ContentControl//Control + public class RevealPanel : ContentControl { public bool IsPressed { diff --git a/FluentWPF/Styles/Window.xaml b/FluentWPF/Styles/Window.xaml index 982335e..9864e4d 100644 --- a/FluentWPF/Styles/Window.xaml +++ b/FluentWPF/Styles/Window.xaml @@ -325,6 +325,7 @@ + @@ -388,7 +389,14 @@ - + + + + + + diff --git a/FluentWPF/Utility/AcrylicHelper.cs b/FluentWPF/Utility/AcrylicHelper.cs index d15995c..f13d350 100644 --- a/FluentWPF/Utility/AcrylicHelper.cs +++ b/FluentWPF/Utility/AcrylicHelper.cs @@ -52,31 +52,11 @@ internal static class AcrylicHelper [DllImport("user32.dll")] internal static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data); - internal static void EnableBlur(IntPtr hwnd, AccentFlagsType style = AccentFlagsType.Window) + internal static void SetBlur(IntPtr hwnd, AccentFlagsType style = AccentFlagsType.Window, AccentState? state = null) { var accent = new AccentPolicy(); var accentStructSize = Marshal.SizeOf(accent); - // ウィンドウ背景のぼかしを行うのはWindows10の場合のみ - // OSのバージョンに従い、AccentStateを切り替える - var currentVersion = SystemInfo.Version.Value; - if (currentVersion >= VersionInfos.Windows10_1903) - { - // Windows10 1903以降では、ACCENT_ENABLE_ACRYLICBLURBEHINDを用いると、ウィンドウのドラッグ移動などでマウス操作に追従しなくなる。 - // SetWindowCompositionAttribute関数の動作が修正されるまで、ACCENT_ENABLE_ACRYLICBLURBEHINDは使用しない。 - accent.AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND; - } - else if (currentVersion >= VersionInfos.Windows10_1809) - { - accent.AccentState = AccentState.ACCENT_ENABLE_ACRYLICBLURBEHIND; - } - else if (currentVersion >= VersionInfos.Windows10) - { - accent.AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND; - } - else - { - accent.AccentState = AccentState.ACCENT_ENABLE_TRANSPARENTGRADIENT; - } + accent.AccentState = state ?? SelectAccentState(); if (style == AccentFlagsType.Window) { @@ -102,5 +82,32 @@ internal static void EnableBlur(IntPtr hwnd, AccentFlagsType style = AccentFlags Marshal.FreeHGlobal(accentPtr); } + + internal static AccentState SelectAccentState(AcrylicAccentState state = AcrylicAccentState.Default) + { + // ウィンドウのアクリル効果を設定する + AccentState value = state switch + { + // ウィンドウ背景のぼかしを行うのはWindows10の場合のみ + // OSのバージョンに従い、AccentStateを切り替える + AcrylicAccentState.Default => SystemInfo.Version.Value switch + { + // Windows10 1903以降では、ACCENT_ENABLE_ACRYLICBLURBEHINDを用いると、ウィンドウのドラッグ移動などでマウス操作に追従しなくなる。 + // ウィンドウの移動/リサイズ中だけ、ACCENT_ENABLE_ACRYLICBLURBEHINDを無効にして、この問題を回避する + //var version when version >= VersionInfos.Windows10_1903 => AccentState.ACCENT_ENABLE_BLURBEHIND, + var version when version >= VersionInfos.Windows10_1809 => AccentState.ACCENT_ENABLE_ACRYLICBLURBEHIND, + var version when version >= VersionInfos.Windows10 => AccentState.ACCENT_ENABLE_BLURBEHIND, + _ => AccentState.ACCENT_ENABLE_TRANSPARENTGRADIENT, + }, + AcrylicAccentState.Disabled => AccentState.ACCENT_DISABLED, + AcrylicAccentState.Gradient => AccentState.ACCENT_ENABLE_GRADIENT, + AcrylicAccentState.TransparentGradient => AccentState.ACCENT_ENABLE_TRANSPARENTGRADIENT, + AcrylicAccentState.BlurBehind => AccentState.ACCENT_ENABLE_BLURBEHIND, + AcrylicAccentState.AcrylicBlurBehind => AccentState.ACCENT_ENABLE_ACRYLICBLURBEHIND, + _ => throw new InvalidOperationException(), + }; + + return value; + } } } diff --git a/Sample/FluentWPFSample/Views/AcrylicWindow3.xaml b/Sample/FluentWPFSample/Views/AcrylicWindow3.xaml index 9b376bc..e49f7fc 100644 --- a/Sample/FluentWPFSample/Views/AcrylicWindow3.xaml +++ b/Sample/FluentWPFSample/Views/AcrylicWindow3.xaml @@ -10,6 +10,7 @@ Title="AcrylicWindow3" Height="450" Width="800" ResizeMode="CanResizeWithGrip" fw:AcrylicWindow.AcrylicWindowStyle="{Binding SelectedValue, ElementName=cmbStyle}" + fw:AcrylicWindow.AcrylicAccentState="{Binding SelectedValue, ElementName=cmbState}" Icon="/Assets/Images/logo_icon.png">