diff --git a/HandyControl/Controls/Attach/InfoElement.cs b/HandyControl/Controls/Attach/InfoElement.cs
index 73777651..654baae1 100644
--- a/HandyControl/Controls/Attach/InfoElement.cs
+++ b/HandyControl/Controls/Attach/InfoElement.cs
@@ -3,18 +3,8 @@ using HandyControl.Data;
namespace HandyControl.Controls
{
- public class InfoElement
+ public class InfoElement : TitleElement
{
- ///
- /// 标题
- ///
- public static readonly DependencyProperty TitleProperty = DependencyProperty.RegisterAttached(
- "Title", typeof(string), typeof(InfoElement), new PropertyMetadata(default(string)));
-
- public static void SetTitle(DependencyObject element, string value) => element.SetValue(TitleProperty, value);
-
- public static string GetTitle(DependencyObject element) => (string) element.GetValue(TitleProperty);
-
///
/// 占位符
///
@@ -45,26 +35,6 @@ namespace HandyControl.Controls
public static string GetSymbol(DependencyObject element) => (string)element.GetValue(SymbolProperty);
- ///
- /// 标题对齐方式
- ///
- public static readonly DependencyProperty TitleAlignmentProperty = DependencyProperty.RegisterAttached(
- "TitleAlignment", typeof(TitleAlignment), typeof(InfoElement), new FrameworkPropertyMetadata(TitleAlignment.Top, FrameworkPropertyMetadataOptions.Inherits));
-
- public static void SetTitleAlignment(DependencyObject element, TitleAlignment value) => element.SetValue(TitleAlignmentProperty, value);
-
- public static TitleAlignment GetTitleAlignment(DependencyObject element) => (TitleAlignment) element.GetValue(TitleAlignmentProperty);
-
- ///
- /// 标题宽度
- ///
- public static readonly DependencyProperty TitleWidthProperty = DependencyProperty.RegisterAttached(
- "TitleWidth", typeof(GridLength), typeof(InfoElement), new FrameworkPropertyMetadata(new GridLength(120.0), FrameworkPropertyMetadataOptions.Inherits));
-
- public static void SetTitleWidth(DependencyObject element, GridLength value) => element.SetValue(TitleWidthProperty, value);
-
- public static GridLength GetTitleWidth(DependencyObject element) => (GridLength)element.GetValue(TitleWidthProperty);
-
///
/// 内容高度
///
diff --git a/HandyControl/Controls/Attach/TitleElement.cs b/HandyControl/Controls/Attach/TitleElement.cs
index 14415c6f..f185f98f 100644
--- a/HandyControl/Controls/Attach/TitleElement.cs
+++ b/HandyControl/Controls/Attach/TitleElement.cs
@@ -1,10 +1,20 @@
using System.Windows;
using System.Windows.Media;
+using HandyControl.Data;
namespace HandyControl.Controls
{
public class TitleElement
{
+ public static readonly DependencyProperty TitleProperty = DependencyProperty.RegisterAttached(
+ "Title", typeof(string), typeof(TitleElement), new PropertyMetadata(default(string)));
+
+ public static void SetTitle(DependencyObject element, string value)
+ => element.SetValue(TitleProperty, value);
+
+ public static string GetTitle(DependencyObject element)
+ => (string) element.GetValue(TitleProperty);
+
public static readonly DependencyProperty BackgroundProperty = DependencyProperty.RegisterAttached(
"Background", typeof(Brush), typeof(TitleElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits));
@@ -31,5 +41,27 @@ namespace HandyControl.Controls
public static Brush GetBorderBrush(DependencyObject element)
=> (Brush) element.GetValue(BorderBrushProperty);
+
+ ///
+ /// 标题对齐方式
+ ///
+ public static readonly DependencyProperty TitleAlignmentProperty = DependencyProperty.RegisterAttached(
+ "TitleAlignment", typeof(TitleAlignment), typeof(TitleElement), new FrameworkPropertyMetadata(TitleAlignment.Top, FrameworkPropertyMetadataOptions.Inherits));
+
+ public static void SetTitleAlignment(DependencyObject element, TitleAlignment value)
+ => element.SetValue(TitleAlignmentProperty, value);
+
+ public static TitleAlignment GetTitleAlignment(DependencyObject element)
+ => (TitleAlignment) element.GetValue(TitleAlignmentProperty);
+
+ ///
+ /// 标题宽度
+ ///
+ public static readonly DependencyProperty TitleWidthProperty = DependencyProperty.RegisterAttached(
+ "TitleWidth", typeof(GridLength), typeof(TitleElement), new FrameworkPropertyMetadata(new GridLength(120.0), FrameworkPropertyMetadataOptions.Inherits));
+
+ public static void SetTitleWidth(DependencyObject element, GridLength value) => element.SetValue(TitleWidthProperty, value);
+
+ public static GridLength GetTitleWidth(DependencyObject element) => (GridLength)element.GetValue(TitleWidthProperty);
}
}
\ No newline at end of file
diff --git a/HandyControl/Controls/Input/NumericUpDown.cs b/HandyControl/Controls/Input/NumericUpDown.cs
index 172bed30..8c539a2d 100644
--- a/HandyControl/Controls/Input/NumericUpDown.cs
+++ b/HandyControl/Controls/Input/NumericUpDown.cs
@@ -150,7 +150,9 @@ namespace HandyControl.Controls
/// 当前值
///
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
- "Value", typeof(double), typeof(NumericUpDown), new PropertyMetadata(default(double), OnValueChanged, CoerceValue), IsValidDoubleValue);
+ "Value", typeof(double), typeof(NumericUpDown),
+ new FrameworkPropertyMetadata(default(double), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
+ OnValueChanged, CoerceValue), IsValidDoubleValue);
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
diff --git a/HandyControl/HandyControl.csproj b/HandyControl/HandyControl.csproj
index 0e710460..d2fe90f8 100644
--- a/HandyControl/HandyControl.csproj
+++ b/HandyControl/HandyControl.csproj
@@ -105,6 +105,8 @@
+
+
diff --git a/HandyControl/Themes/Basic/Converters.xaml b/HandyControl/Themes/Basic/Converters.xaml
index a4ae0c09..8a4d418f 100644
--- a/HandyControl/Themes/Basic/Converters.xaml
+++ b/HandyControl/Themes/Basic/Converters.xaml
@@ -13,5 +13,7 @@
+
+
\ No newline at end of file
diff --git a/HandyControl/Themes/Styles/Base/GroupBoxBaseStyle.xaml b/HandyControl/Themes/Styles/Base/GroupBoxBaseStyle.xaml
index 69d1f5fa..839b57bc 100644
--- a/HandyControl/Themes/Styles/Base/GroupBoxBaseStyle.xaml
+++ b/HandyControl/Themes/Styles/Base/GroupBoxBaseStyle.xaml
@@ -2,34 +2,144 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HandyControl/Themes/Styles/GroupBox.xaml b/HandyControl/Themes/Styles/GroupBox.xaml
index eda414ae..86ee6b9b 100644
--- a/HandyControl/Themes/Styles/GroupBox.xaml
+++ b/HandyControl/Themes/Styles/GroupBox.xaml
@@ -1,6 +1,5 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
@@ -8,45 +7,8 @@
-
+
-
+
\ No newline at end of file
diff --git a/HandyControl/Themes/Styles/ToggleButton.xaml b/HandyControl/Themes/Styles/ToggleButton.xaml
index d9f2f408..00e060b3 100644
--- a/HandyControl/Themes/Styles/ToggleButton.xaml
+++ b/HandyControl/Themes/Styles/ToggleButton.xaml
@@ -120,7 +120,7 @@
-
+
diff --git a/HandyControl/Tools/Converter/Boolean2StrConverter.cs b/HandyControl/Tools/Converter/Boolean2StrConverter.cs
new file mode 100644
index 00000000..21d30e01
--- /dev/null
+++ b/HandyControl/Tools/Converter/Boolean2StrConverter.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace HandyControl.Tools.Converter
+{
+ public class Boolean2StrConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is bool boolValue)
+ {
+ if (parameter is string str)
+ {
+ var arr = str.Split(';');
+ if (arr.Length > 1)
+ {
+ return boolValue ? arr[1] : arr[0];
+ }
+ return "";
+ }
+ return "";
+ }
+ return "";
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
diff --git a/HandyControl/Tools/Converter/Int2StrConverter.cs b/HandyControl/Tools/Converter/Int2StrConverter.cs
new file mode 100644
index 00000000..3ebfff45
--- /dev/null
+++ b/HandyControl/Tools/Converter/Int2StrConverter.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace HandyControl.Tools.Converter
+{
+ public class Int2StrConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is int intValue)
+ {
+ if (parameter is string str)
+ {
+ var arr = str.Split(';');
+ if (arr.Length > intValue)
+ {
+ return arr[intValue];
+ }
+
+ return intValue;
+ }
+
+ return intValue;
+ }
+
+ return value;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
diff --git a/HandyControlDemo/Resources/Img/icon.ico b/HandyControlDemo/Resources/Img/icon.ico
index 3505fe70..719edf88 100644
Binary files a/HandyControlDemo/Resources/Img/icon.ico and b/HandyControlDemo/Resources/Img/icon.ico differ
diff --git a/HandyControlDemo/UserControl/Main/LeftMainContent.xaml b/HandyControlDemo/UserControl/Main/LeftMainContent.xaml
index 6e8664fb..6bbb4b1b 100644
--- a/HandyControlDemo/UserControl/Main/LeftMainContent.xaml
+++ b/HandyControlDemo/UserControl/Main/LeftMainContent.xaml
@@ -115,7 +115,7 @@
-
+
@@ -189,22 +189,22 @@
-
+
-
+
-
+
-
+
diff --git a/HandyControlDemo/UserControl/Styles/GroupBoxDemoCtl.xaml b/HandyControlDemo/UserControl/Styles/GroupBoxDemoCtl.xaml
index e33235c7..53fdfe45 100644
--- a/HandyControlDemo/UserControl/Styles/GroupBoxDemoCtl.xaml
+++ b/HandyControlDemo/UserControl/Styles/GroupBoxDemoCtl.xaml
@@ -6,23 +6,44 @@
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl">
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index 04f5da44..8e59e9e5 100644
--- a/README.md
+++ b/README.md
@@ -118,6 +118,10 @@

+### GroupBox
+
+
+
### StepBar

diff --git a/Resources/GroupBox.png b/Resources/GroupBox.png
new file mode 100644
index 00000000..aa93b7c4
Binary files /dev/null and b/Resources/GroupBox.png differ