From bd3608a73eca97ab82f9d9aa9e08167a350e4374 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Tue, 9 Oct 2018 17:35:08 +0800
Subject: [PATCH] trim the styles of some controls
---
HandyControl/Controls/Attach/InfoElement.cs | 10 +++
HandyControl/Controls/TimePicker.cs | 2 +
HandyControl/Properties/AssemblyInfo.cs | 4 +-
.../Themes/Styles/Base/ComboBoxBaseStyle.xaml | 74 +++++++++++++------
.../Styles/Base/DatePickerBaseStyle.xaml | 7 +-
.../Styles/Base/PasswordBoxBaseStyle.xaml | 2 +-
.../Themes/Styles/Base/TextBoxBaseStyle.xaml | 7 +-
.../Styles/Base/TimePickerBaseStyle.xaml | 2 +-
HandyControl/Themes/Styles/DatePicker.xaml | 22 +++---
HandyControl/Themes/Styles/PasswordBox.xaml | 25 ++++---
HandyControl/Themes/Styles/TextBox.xaml | 28 +++----
HandyControl/Themes/Styles/TimePicker.xaml | 16 ++--
HandyControlDemo/Properties/AssemblyInfo.cs | 4 +-
13 files changed, 122 insertions(+), 81 deletions(-)
diff --git a/HandyControl/Controls/Attach/InfoElement.cs b/HandyControl/Controls/Attach/InfoElement.cs
index 04df5f96..6a4cf320 100644
--- a/HandyControl/Controls/Attach/InfoElement.cs
+++ b/HandyControl/Controls/Attach/InfoElement.cs
@@ -65,5 +65,15 @@ namespace HandyControl.Controls
public static void SetTitleWidth(DependencyObject element, GridLength value) => element.SetValue(TitleWidthProperty, value);
public static GridLength GetTitleWidth(DependencyObject element) => (GridLength)element.GetValue(TitleWidthProperty);
+
+ ///
+ /// 内容高度
+ ///
+ public static readonly DependencyProperty ContentHeightProperty = DependencyProperty.RegisterAttached(
+ "ContentHeight", typeof(double), typeof(InfoElement), new PropertyMetadata(30.0));
+
+ public static void SetContentHeight(DependencyObject element, double value) => element.SetValue(ContentHeightProperty, value);
+
+ public static double GetContentHeight(DependencyObject element) => (double)element.GetValue(ContentHeightProperty);
}
}
\ No newline at end of file
diff --git a/HandyControl/Controls/TimePicker.cs b/HandyControl/Controls/TimePicker.cs
index 28605a8c..d1781a80 100644
--- a/HandyControl/Controls/TimePicker.cs
+++ b/HandyControl/Controls/TimePicker.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
@@ -250,6 +251,7 @@ namespace HandyControl.Controls
public override void OnApplyTemplate()
{
+ if (DesignerProperties.GetIsInDesignMode(this)) return;
if (_popUp != null)
{
_popUp.RemoveHandler(PreviewMouseLeftButtonDownEvent, new MouseButtonEventHandler(PopUp_PreviewMouseLeftButtonDown));
diff --git a/HandyControl/Properties/AssemblyInfo.cs b/HandyControl/Properties/AssemblyInfo.cs
index 21296cda..05f94427 100644
--- a/HandyControl/Properties/AssemblyInfo.cs
+++ b/HandyControl/Properties/AssemblyInfo.cs
@@ -10,5 +10,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
-[assembly: AssemblyVersion("1.3.1.0")]
-[assembly: AssemblyFileVersion("1.3.1.0")]
+[assembly: AssemblyVersion("1.3.1.1")]
+[assembly: AssemblyFileVersion("1.3.1.1")]
diff --git a/HandyControl/Themes/Styles/Base/ComboBoxBaseStyle.xaml b/HandyControl/Themes/Styles/Base/ComboBoxBaseStyle.xaml
index fe644631..d4eb6ca9 100644
--- a/HandyControl/Themes/Styles/Base/ComboBoxBaseStyle.xaml
+++ b/HandyControl/Themes/Styles/Base/ComboBoxBaseStyle.xaml
@@ -32,6 +32,32 @@
+
+
@@ -51,7 +77,7 @@
-
+
@@ -92,17 +118,16 @@
-
+
-
+
-
@@ -115,8 +140,8 @@
-
-
+
+
@@ -154,17 +179,16 @@
-
+
-
+
-
@@ -177,8 +201,8 @@
-
-
+
+
@@ -220,13 +244,14 @@
+
-
+
@@ -251,8 +276,8 @@
-
-
+
+
@@ -301,17 +326,16 @@
-
+
-
+
-
@@ -324,9 +348,10 @@
-
+
+
-
+
@@ -372,17 +397,16 @@
-
+
-
+
-
@@ -395,9 +419,10 @@
-
+
+
-
+
@@ -510,6 +535,7 @@
+
diff --git a/HandyControl/Themes/Styles/Base/DatePickerBaseStyle.xaml b/HandyControl/Themes/Styles/Base/DatePickerBaseStyle.xaml
index 81d8072e..48ef45a7 100644
--- a/HandyControl/Themes/Styles/Base/DatePickerBaseStyle.xaml
+++ b/HandyControl/Themes/Styles/Base/DatePickerBaseStyle.xaml
@@ -16,9 +16,9 @@
-
+
-
+
@@ -36,6 +36,7 @@
+
@@ -48,7 +49,7 @@
-
+
diff --git a/HandyControl/Themes/Styles/Base/PasswordBoxBaseStyle.xaml b/HandyControl/Themes/Styles/Base/PasswordBoxBaseStyle.xaml
index 79198f07..bc102f40 100644
--- a/HandyControl/Themes/Styles/Base/PasswordBoxBaseStyle.xaml
+++ b/HandyControl/Themes/Styles/Base/PasswordBoxBaseStyle.xaml
@@ -23,7 +23,7 @@
-
+
diff --git a/HandyControl/Themes/Styles/Base/TextBoxBaseStyle.xaml b/HandyControl/Themes/Styles/Base/TextBoxBaseStyle.xaml
index 407f9680..e7d40ae3 100644
--- a/HandyControl/Themes/Styles/Base/TextBoxBaseStyle.xaml
+++ b/HandyControl/Themes/Styles/Base/TextBoxBaseStyle.xaml
@@ -10,13 +10,14 @@
+
-
+
-
+
@@ -45,7 +46,7 @@
-
+
diff --git a/HandyControl/Themes/Styles/Base/TimePickerBaseStyle.xaml b/HandyControl/Themes/Styles/Base/TimePickerBaseStyle.xaml
index 4d25ca7f..0249997e 100644
--- a/HandyControl/Themes/Styles/Base/TimePickerBaseStyle.xaml
+++ b/HandyControl/Themes/Styles/Base/TimePickerBaseStyle.xaml
@@ -26,7 +26,7 @@
-
+
diff --git a/HandyControl/Themes/Styles/DatePicker.xaml b/HandyControl/Themes/Styles/DatePicker.xaml
index 6ba61cd0..5afd9864 100644
--- a/HandyControl/Themes/Styles/DatePicker.xaml
+++ b/HandyControl/Themes/Styles/DatePicker.xaml
@@ -13,13 +13,13 @@
-
+
-
+
@@ -27,7 +27,7 @@
-
+
@@ -38,14 +38,14 @@
-
+
-
+
@@ -60,16 +60,16 @@
-
+
-
+
-
+
@@ -77,7 +77,7 @@
-
+
@@ -88,14 +88,14 @@
-
+
-
+
diff --git a/HandyControl/Themes/Styles/PasswordBox.xaml b/HandyControl/Themes/Styles/PasswordBox.xaml
index b0406953..f4409870 100644
--- a/HandyControl/Themes/Styles/PasswordBox.xaml
+++ b/HandyControl/Themes/Styles/PasswordBox.xaml
@@ -15,15 +15,15 @@
-
+
-
+
-
-
-
+
+
+
@@ -32,7 +32,7 @@
-
+
@@ -42,18 +42,18 @@
-
+
-
+
-
-
-
+
+
+
@@ -62,7 +62,7 @@
-
+
@@ -75,6 +75,7 @@
+
diff --git a/HandyControl/Themes/Styles/TextBox.xaml b/HandyControl/Themes/Styles/TextBox.xaml
index 12a6cfa2..0a2c0c6f 100644
--- a/HandyControl/Themes/Styles/TextBox.xaml
+++ b/HandyControl/Themes/Styles/TextBox.xaml
@@ -17,21 +17,21 @@
-
+
-
+
-
-
-
+
+
+
-
+
@@ -41,24 +41,24 @@
-
+
-
+
-
-
-
+
+
+
-
+
@@ -68,9 +68,9 @@