diff --git a/HandyControl/Controls/Window/BlurWindow.cs b/HandyControl/Controls/Window/BlurWindow.cs index 44582434..accf561d 100644 --- a/HandyControl/Controls/Window/BlurWindow.cs +++ b/HandyControl/Controls/Window/BlurWindow.cs @@ -1,5 +1,6 @@ using System.Runtime.InteropServices; using System.Windows.Interop; +using System.Windows.Media; using HandyControl.Data; using HandyControl.Tools; @@ -30,6 +31,10 @@ namespace HandyControl.Controls } else { + var colorValue = ResourceHelper.GetResource(ResourceToken.BlurGradientValue); + var color = ColorHelper.ToColor(colorValue); + color = Color.FromRgb(color.R, color.G, color.B); + window.Background = new SolidColorBrush(color); return; } diff --git a/HandyControl/Tools/Helper/ColorHelper.cs b/HandyControl/Tools/Helper/ColorHelper.cs index 6163f7bc..4a853dc8 100644 --- a/HandyControl/Tools/Helper/ColorHelper.cs +++ b/HandyControl/Tools/Helper/ColorHelper.cs @@ -1,4 +1,5 @@ -using System.Windows.Media; +using System; +using System.Windows.Media; namespace HandyControl.Tools { @@ -9,5 +10,11 @@ namespace HandyControl.Tools private const int Win32BlueShift = 16; public static int ToWin32(Color c) => c.R << Win32RedShift | c.G << Win32GreenShift | c.B << Win32BlueShift; + + public static Color ToColor(uint c) + { + var bytes = BitConverter.GetBytes(c); + return Color.FromArgb(bytes[3], bytes[2], bytes[1], bytes[0]); + } } } \ No newline at end of file diff --git a/HandyControlDemo/Data/AppConfig.cs b/HandyControlDemo/Data/AppConfig.cs index 6e3412aa..1768fb96 100644 --- a/HandyControlDemo/Data/AppConfig.cs +++ b/HandyControlDemo/Data/AppConfig.cs @@ -7,7 +7,7 @@ namespace HandyControlDemo.Data { public static string SavePath = $"{AppDomain.CurrentDomain.BaseDirectory}AppConfig.json"; - public string Lang { get; set; } = "cn"; + public string Lang { get; set; } = "zh-cn"; public SkinType Skin { get; set; } } diff --git a/HandyControlDemo/UserControl/Main/LeftMainContent.xaml b/HandyControlDemo/UserControl/Main/LeftMainContent.xaml index 0546e8db..c7abc8a1 100644 --- a/HandyControlDemo/UserControl/Main/LeftMainContent.xaml +++ b/HandyControlDemo/UserControl/Main/LeftMainContent.xaml @@ -4,7 +4,7 @@ x:Class="HandyControlDemo.UserControl.LeftMainContent" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:data="clr-namespace:HandyControlDemo.Data" - Background="Transparent" + Background="{Binding Background,RelativeSource={RelativeSource FindAncestor,AncestorType=Window}}" xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl" xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> diff --git a/HandyControlDemo/UserControl/Main/NoUserContent.xaml b/HandyControlDemo/UserControl/Main/NoUserContent.xaml index c4b36c88..8a4efbfd 100644 --- a/HandyControlDemo/UserControl/Main/NoUserContent.xaml +++ b/HandyControlDemo/UserControl/Main/NoUserContent.xaml @@ -70,7 +70,7 @@ -