整理控件库
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
|
||||
|
||||
|
||||
using WPFluent.Controls;
|
||||
using WPFluent.Controls;
|
||||
using WPFluent.Interop;
|
||||
|
||||
namespace WPFluent.Appearance;
|
||||
@@ -18,7 +15,7 @@ public static class WindowBackgroundManager
|
||||
/// <summary>
|
||||
/// Forces change to application background. Required if custom background effect was previously applied.
|
||||
/// </summary>
|
||||
public static void UpdateBackground(Window? window, ApplicationTheme applicationTheme, WindowBackdropType backdrop)
|
||||
public static void UpdateBackground(Window? window, ThemeType applicationTheme, WindowBackdropType backdrop)
|
||||
{
|
||||
if (window is null)
|
||||
{
|
||||
@@ -27,23 +24,19 @@ public static class WindowBackgroundManager
|
||||
|
||||
//_ = WindowBackdrop.RemoveBackdrop(window);
|
||||
|
||||
if (applicationTheme == ApplicationTheme.Unknown)
|
||||
if (applicationTheme == ThemeType.Unknow)
|
||||
{
|
||||
backdrop = WindowBackdropType.None;
|
||||
}
|
||||
|
||||
// This was required to update the background when moving from a HC theme to light/dark theme. However, this breaks theme proper light/dark theme changing on Windows 10.
|
||||
// But window backdrop effects are not applied when it has an opaque (or any) background on W11 (so removing this breaks backdrop effects when switching themes), however, for legacy MICA it may not be required
|
||||
// using existing variable, though the OS build which (officially) supports setting DWM_SYSTEMBACKDROP_TYPE attribute is build 22621
|
||||
// source: https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type
|
||||
if (Win32.Utilities.IsOSWindows11Insider1OrNewer && backdrop is not WindowBackdropType.None)
|
||||
if (backdrop is not WindowBackdropType.None)
|
||||
{
|
||||
_ = WindowBackdrop.RemoveBackground(window);
|
||||
}
|
||||
|
||||
//_ = WindowBackdrop.ApplyBackdrop(window, backdrop);
|
||||
|
||||
if (applicationTheme is ApplicationTheme.Dark)
|
||||
if (applicationTheme is ThemeType.Dark)
|
||||
{
|
||||
//ApplyDarkThemeToWindow(window);
|
||||
}
|
||||
@@ -60,7 +53,7 @@ public static class WindowBackgroundManager
|
||||
{
|
||||
//_ = WindowBackdrop.ApplyBackdrop(windowSubWindow, backdrop);
|
||||
|
||||
if (applicationTheme is ApplicationTheme.Dark)
|
||||
if (applicationTheme is ThemeType.Dark)
|
||||
{
|
||||
//ApplyDarkThemeToWindow(windowSubWindow);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user