From 61ee9a533790b53897f72dc88e8700df0548cdeb Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Sun, 19 Apr 2020 13:29:19 +0800 Subject: [PATCH] close #362 --- .../Themes/Styles/Base/ComboBoxBaseStyle.xaml | 108 +++++++++++++----- .../Styles/NativeComboBoxDemoCtl.xaml | 4 +- .../Controls/Attach/DropDownElement.cs | 18 +++ .../HandyControl_Shared.projitems | 1 + .../Themes/Styles/Base/ComboBoxBaseStyle.xaml | 108 +++++++++++++----- 5 files changed, 181 insertions(+), 58 deletions(-) create mode 100644 src/Shared/HandyControl_Shared/Controls/Attach/DropDownElement.cs diff --git a/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/ComboBoxBaseStyle.xaml b/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/ComboBoxBaseStyle.xaml index 221e66e8..dd91d422 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/ComboBoxBaseStyle.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/ComboBoxBaseStyle.xaml @@ -79,8 +79,8 @@ - - + + @@ -100,6 +100,10 @@ + + + + @@ -138,8 +142,8 @@ - - + + @@ -159,6 +163,10 @@ + + + + @@ -195,8 +203,8 @@ - - + + @@ -216,6 +224,10 @@ + + + + @@ -266,8 +278,8 @@ - - + + @@ -287,6 +299,10 @@ + + + + @@ -325,8 +341,8 @@ - - + + @@ -346,6 +362,10 @@ + + + + @@ -382,8 +402,8 @@ - - + + @@ -403,6 +423,10 @@ + + + + @@ -548,8 +572,8 @@ - - + + @@ -571,6 +595,10 @@ + + + + @@ -645,8 +673,8 @@ - - + + @@ -668,6 +696,10 @@ + + + + @@ -745,8 +777,8 @@ - - + + @@ -768,6 +800,10 @@ + + + + @@ -862,8 +898,8 @@ - - + + @@ -874,8 +910,8 @@ - - + + @@ -898,6 +934,12 @@ + + + + + + @@ -994,8 +1036,8 @@ - - + + @@ -1017,6 +1059,10 @@ + + + + @@ -1108,8 +1154,8 @@ - - + + @@ -1120,8 +1166,8 @@ - - + + @@ -1144,6 +1190,12 @@ + + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/NativeComboBoxDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/NativeComboBoxDemoCtl.xaml index 709828a3..c5dd74a5 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/NativeComboBoxDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/NativeComboBoxDemoCtl.xaml @@ -9,11 +9,11 @@ - + - + diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/DropDownElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/DropDownElement.cs new file mode 100644 index 00000000..cb88e93e --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/Attach/DropDownElement.cs @@ -0,0 +1,18 @@ +using System.Windows; +using HandyControl.Data; + +namespace HandyControl.Controls +{ + public class DropDownElement + { + public static readonly DependencyProperty ConsistentWidthProperty = DependencyProperty.RegisterAttached( + "ConsistentWidth", typeof(bool), typeof(DropDownElement), + new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetConsistentWidth(DependencyObject element, bool value) + => element.SetValue(ConsistentWidthProperty, value); + + public static bool GetConsistentWidth(DependencyObject element) + => (bool) element.GetValue(ConsistentWidthProperty); + } +} diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems index 9e017186..7fd0cd13 100644 --- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems +++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems @@ -13,6 +13,7 @@ + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ComboBoxBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ComboBoxBaseStyle.xaml index c12c3416..d54c1e3a 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ComboBoxBaseStyle.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ComboBoxBaseStyle.xaml @@ -79,8 +79,8 @@ - - + + @@ -100,6 +100,10 @@ + + + + @@ -145,8 +149,8 @@ - - + + @@ -166,6 +170,10 @@ + + + + @@ -209,8 +217,8 @@ - - + + @@ -230,6 +238,10 @@ + + + + @@ -287,8 +299,8 @@ - - + + @@ -308,6 +320,10 @@ + + + + @@ -353,8 +369,8 @@ - - + + @@ -374,6 +390,10 @@ + + + + @@ -417,8 +437,8 @@ - - + + @@ -438,6 +458,10 @@ + + + + @@ -590,8 +614,8 @@ - - + + @@ -613,6 +637,10 @@ + + + + @@ -694,8 +722,8 @@ - - + + @@ -717,6 +745,10 @@ + + + + @@ -801,8 +833,8 @@ - - + + @@ -824,6 +856,10 @@ + + + + @@ -925,8 +961,8 @@ - - + + @@ -937,8 +973,8 @@ - - + + @@ -961,6 +997,12 @@ + + + + + + @@ -1064,8 +1106,8 @@ - - + + @@ -1087,6 +1129,10 @@ + + + + @@ -1185,8 +1231,8 @@ - - + + @@ -1197,8 +1243,8 @@ - - + + @@ -1221,6 +1267,12 @@ + + + + + +