diff --git a/HandyControl/Controls/Window/ImageBrowser.cs b/HandyControl/Controls/Window/ImageBrowser.cs index f3b05c84..6fd74a3e 100644 --- a/HandyControl/Controls/Window/ImageBrowser.cs +++ b/HandyControl/Controls/Window/ImageBrowser.cs @@ -3,7 +3,6 @@ using System.Diagnostics; using System.IO; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; @@ -51,7 +50,7 @@ namespace HandyControl.Controls private Grid _gridTop; - private Grid _canvasMain; + private Grid _gridMain; private Canvas _canvasSmallImg; @@ -304,7 +303,7 @@ namespace HandyControl.Controls base.OnApplyTemplate(); _gridTop = GetTemplateChild(ElementGridTop) as Grid; - _canvasMain = GetTemplateChild(ElementGridMain) as Grid; + _gridMain = GetTemplateChild(ElementGridMain) as Grid; _canvasSmallImg = GetTemplateChild(ElementCanvasSmallImg) as Canvas; _borderMove = GetTemplateChild(ElementBorderMove) as Border; _imageMain = GetTemplateChild(ElementImageMain) as Image; @@ -639,10 +638,10 @@ namespace HandyControl.Controls DragMove(); return; } - _imgMouseDownPoint = Mouse.GetPosition(_canvasMain); + _imgMouseDownPoint = Mouse.GetPosition(_gridMain); _imgMouseDownMargin = ImageMargin; _imgIsMouseLeftButtonDown = true; - e.Handled = true; + //e.Handled = true; } protected override void OnPreviewMouseLeftButtonUp(MouseButtonEventArgs e) @@ -734,7 +733,7 @@ namespace HandyControl.Controls ImageScale = tempScale; - var posCanvas = Mouse.GetPosition(_canvasMain); + var posCanvas = Mouse.GetPosition(_gridMain); var posImg = new Point(posCanvas.X - _imgActualMargin.Left, posCanvas.Y - _imgActualMargin.Top); var marginX = .5 * _scaleInternalWidth; @@ -823,7 +822,7 @@ namespace HandyControl.Controls /// private void MoveImg() { - _imgCurrentPoint = Mouse.GetPosition(_canvasMain); + _imgCurrentPoint = Mouse.GetPosition(_gridMain); ShowCloseButton = _imgCurrentPoint.Y < 200; ShowBorderBottom = _imgCurrentPoint.Y > ActualHeight - 200; diff --git a/HandyControl/Data/Enum/SkinType.cs b/HandyControl/Data/Enum/SkinType.cs index e329ecd4..5fb63e6f 100644 --- a/HandyControl/Data/Enum/SkinType.cs +++ b/HandyControl/Data/Enum/SkinType.cs @@ -2,7 +2,8 @@ { public enum SkinType { - Default = 0, - Dark + Default, + Dark, + Violet } } \ No newline at end of file diff --git a/HandyControl/HandyControl.csproj b/HandyControl/HandyControl.csproj index 2928d66d..6a376c28 100644 --- a/HandyControl/HandyControl.csproj +++ b/HandyControl/HandyControl.csproj @@ -169,6 +169,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -197,6 +201,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/HandyControl/Themes/Basic/Colors/ColorsViolet.xaml b/HandyControl/Themes/Basic/Colors/ColorsViolet.xaml new file mode 100644 index 00000000..f7ac5866 --- /dev/null +++ b/HandyControl/Themes/Basic/Colors/ColorsViolet.xaml @@ -0,0 +1,43 @@ + + + #ba68c8 + #7b1fa2 + + #ff8792 + #ff4c9f + + #ffd180 + #ff9100 + + #4dd0e1 + #00bcd4 + + #A5D6A7 + #4CAF50 + + #212121 + #757575 + #bdbdbd + #212121 + White + + #e0e0e0 + #757575 + #eeeeee + #ffffff + #eeeeee + White + #ba68c8 + #7b1fa2 + + White + #f5f5f5 + + #ff5722 + #d43f3a + + #20000000 + #40000000 + + \ No newline at end of file diff --git a/HandyControl/Themes/SkinViolet.xaml b/HandyControl/Themes/SkinViolet.xaml new file mode 100644 index 00000000..a0aa7e23 --- /dev/null +++ b/HandyControl/Themes/SkinViolet.xaml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/HandyControl/Themes/Styles/Base/ContextMenuBaseStyle.xaml b/HandyControl/Themes/Styles/Base/ContextMenuBaseStyle.xaml index b43935c4..d970596e 100644 --- a/HandyControl/Themes/Styles/Base/ContextMenuBaseStyle.xaml +++ b/HandyControl/Themes/Styles/Base/ContextMenuBaseStyle.xaml @@ -96,10 +96,6 @@ - - - - @@ -134,17 +130,13 @@ - + - - - - @@ -202,7 +194,7 @@ - + diff --git a/HandyControl/Tools/ResourceHelper.cs b/HandyControl/Tools/ResourceHelper.cs index 5087d5f1..794d4181 100644 --- a/HandyControl/Tools/ResourceHelper.cs +++ b/HandyControl/Tools/ResourceHelper.cs @@ -59,9 +59,23 @@ namespace HandyControl.Tools /// /// /// - public static ResourceDictionary GetSkin(Assembly assembly, string themePath, SkinType skin) => new ResourceDictionary + public static ResourceDictionary GetSkin(Assembly assembly, string themePath, SkinType skin) { - Source = new Uri($"pack://application:,,,/{assembly.GetName().Name};component/{themePath}/Skin{skin.ToString()}.xaml") - }; + try + { + var uri = new Uri($"pack://application:,,,/{assembly.GetName().Name};component/{themePath}/Skin{skin.ToString()}.xaml"); + return new ResourceDictionary + { + Source = uri + }; + } + catch + { + return new ResourceDictionary + { + Source = new Uri($"pack://application:,,,/{assembly.GetName().Name};component/{themePath}/Skin{SkinType.Default.ToString()}.xaml") + }; + } + } } } \ No newline at end of file diff --git a/HandyControlDemo/UserControl/Main/NoUserContent.xaml b/HandyControlDemo/UserControl/Main/NoUserContent.xaml index beef992a..77d8c4bb 100644 --- a/HandyControlDemo/UserControl/Main/NoUserContent.xaml +++ b/HandyControlDemo/UserControl/Main/NoUserContent.xaml @@ -74,6 +74,9 @@ +