From a68b0213a66c36a75750ccda22407a666d269721 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Thu, 20 Sep 2018 16:09:43 +0800 Subject: [PATCH] modify button, toggle button style --- .../Controls/Attach/StatusSwitchElement.cs | 13 ++ HandyControl/Controls/Carousel.xaml | 4 +- HandyControl/Controls/Carousel.xaml.cs | 2 +- HandyControl/Controls/ColorPicker.xaml.cs | 2 +- HandyControl/Controls/Growl.xaml | 6 +- .../Controls/Info/InfoNumericUpDown.xaml | 6 +- HandyControl/Controls/Info/InfoTextBox.xaml | 2 +- HandyControl/Controls/Pagination.xaml | 4 +- .../Controls/Window/ImageBrowser.xaml | 16 +- HandyControl/Controls/Window/PopupWindow.xaml | 6 +- HandyControl/HandyControl.csproj | 4 - HandyControl/Properties/AssemblyInfo.cs | 4 +- .../Themes/Styles/Base/ButtonBaseStyle.xaml | 44 ++-- .../Styles/Base/ToggleButtonBaseStyle.xaml | 203 +++++++++++++++++- .../Base/ToggleButtonSwitchBaseStyle.xaml | 186 ---------------- HandyControl/Themes/Styles/Button.xaml | 38 ++-- HandyControl/Themes/Styles/Expander.xaml | 2 +- HandyControl/Themes/Styles/Style.xaml | 2 +- HandyControl/Themes/Styles/TabControl.xaml | 2 +- HandyControl/Themes/Styles/ToggleButton.xaml | 30 ++- HandyControl/Themes/Styles/Window.xaml | 8 +- HandyControlDemo/Properties/AssemblyInfo.cs | 4 +- .../Properties/Langs/Lang.Designer.cs | 18 ++ .../Properties/Langs/Lang.en.resx | 6 + HandyControlDemo/Properties/Langs/Lang.resx | 6 + .../UserControl/Main/NoUserContent.xaml | 2 +- .../UserControl/Styles/ButtonDemoCtl.xaml | 58 ++--- .../Styles/ToggleButtonDemoCtl.xaml | 105 +++++---- 28 files changed, 430 insertions(+), 353 deletions(-) delete mode 100644 HandyControl/Themes/Styles/Base/ToggleButtonSwitchBaseStyle.xaml diff --git a/HandyControl/Controls/Attach/StatusSwitchElement.cs b/HandyControl/Controls/Attach/StatusSwitchElement.cs index 6c52ab80..1c3f3e1a 100644 --- a/HandyControl/Controls/Attach/StatusSwitchElement.cs +++ b/HandyControl/Controls/Attach/StatusSwitchElement.cs @@ -5,11 +5,24 @@ namespace HandyControl.Controls { public class StatusSwitchElement { + /// + /// 选中时展示的元素 + /// public static readonly DependencyProperty CheckedElementProperty = DependencyProperty.RegisterAttached( "CheckedElement", typeof(object), typeof(StatusSwitchElement), new PropertyMetadata(default(object))); public static void SetCheckedElement(DependencyObject element, object value) => element.SetValue(CheckedElementProperty, value); public static object GetCheckedElement(DependencyObject element) => element.GetValue(CheckedElementProperty); + + /// + /// 是否隐藏元素 + /// + public static readonly DependencyProperty HiddenElementProperty = DependencyProperty.RegisterAttached( + "HiddenElement", typeof(bool), typeof(StatusSwitchElement), new PropertyMetadata(default(bool))); + + public static void SetHiddenElement(DependencyObject element, bool value) => element.SetValue(HiddenElementProperty, value); + + public static bool GetHiddenElement(DependencyObject element) => (bool) element.GetValue(HiddenElementProperty); } } \ No newline at end of file diff --git a/HandyControl/Controls/Carousel.xaml b/HandyControl/Controls/Carousel.xaml index ef82e01e..942c03ee 100644 --- a/HandyControl/Controls/Carousel.xaml +++ b/HandyControl/Controls/Carousel.xaml @@ -28,12 +28,12 @@ - - - - diff --git a/HandyControl/Controls/Info/InfoNumericUpDown.xaml b/HandyControl/Controls/Info/InfoNumericUpDown.xaml index 519e5614..e9c40029 100644 --- a/HandyControl/Controls/Info/InfoNumericUpDown.xaml +++ b/HandyControl/Controls/Info/InfoNumericUpDown.xaml @@ -56,9 +56,9 @@ - - - + + + diff --git a/HandyControl/Controls/Info/InfoTextBox.xaml b/HandyControl/Controls/Info/InfoTextBox.xaml index 18930a13..4889a9e2 100644 --- a/HandyControl/Controls/Info/InfoTextBox.xaml +++ b/HandyControl/Controls/Info/InfoTextBox.xaml @@ -54,7 +54,7 @@ - + diff --git a/HandyControl/Controls/Pagination.xaml b/HandyControl/Controls/Pagination.xaml index a7cc89d4..9b3c1af9 100644 --- a/HandyControl/Controls/Pagination.xaml +++ b/HandyControl/Controls/Pagination.xaml @@ -16,7 +16,7 @@ - - + + - + - - + - - + + \ No newline at end of file diff --git a/HandyControl/Controls/Window/PopupWindow.xaml b/HandyControl/Controls/Window/PopupWindow.xaml index 5d1d6f54..4a3f1660 100644 --- a/HandyControl/Controls/Window/PopupWindow.xaml +++ b/HandyControl/Controls/Window/PopupWindow.xaml @@ -36,7 +36,7 @@ - @@ -44,12 +44,12 @@ - -