diff --git a/DeedyDesigner/Deedy.Testing/App.xaml b/DeedyDesigner/Deedy.Testing/App.xaml index 432a085..6c8a59b 100644 --- a/DeedyDesigner/Deedy.Testing/App.xaml +++ b/DeedyDesigner/Deedy.Testing/App.xaml @@ -1,9 +1,154 @@ - - + + + + + + + + + + + + + + + 400 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DeedyDesigner/Deedy.Testing/App.xaml.cs b/DeedyDesigner/Deedy.Testing/App.xaml.cs index cb2470b..cc36506 100644 --- a/DeedyDesigner/Deedy.Testing/App.xaml.cs +++ b/DeedyDesigner/Deedy.Testing/App.xaml.cs @@ -2,7 +2,7 @@ using System.Data; using System.Windows; -namespace Deedy.Testing +namespace Deedy { /// /// Interaction logic for App.xaml diff --git a/DeedyDesigner/Deedy.Testing/ElegantWindow.cs b/DeedyDesigner/Deedy.Testing/ElegantWindow.cs index be84e57..bad83bc 100644 --- a/DeedyDesigner/Deedy.Testing/ElegantWindow.cs +++ b/DeedyDesigner/Deedy.Testing/ElegantWindow.cs @@ -13,7 +13,7 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; -namespace Deedy.Testing +namespace Deedy { /// /// 按照步骤 1a 或 1b 操作,然后执行步骤 2 以在 XAML 文件中使用此自定义控件。 @@ -22,14 +22,14 @@ namespace Deedy.Testing /// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根 /// 元素中: /// - /// xmlns:MyNamespace="clr-namespace:Deedy.Testing" + /// xmlns:MyNamespace="clr-namespace:Deedy" /// /// /// 步骤 1b) 在其他项目中存在的 XAML 文件中使用该自定义控件。 /// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根 /// 元素中: /// - /// xmlns:MyNamespace="clr-namespace:Deedy.Testing;assembly=Deedy.Testing" + /// xmlns:MyNamespace="clr-namespace:Deedy;assembly=Deedy" /// /// 您还需要添加一个从 XAML 文件所在的项目到此项目的项目引用, /// 并重新生成以避免编译错误: @@ -44,6 +44,9 @@ namespace Deedy.Testing /// /// /// + [TemplatePart(Name = "PART_MinButton", Type = typeof(Button))] + [TemplatePart(Name = "PART_MaxButton", Type = typeof(Button))] + [TemplatePart(Name = "PART_CloseButton", Type = typeof(Button))] public class ElegantWindow : Window { static ElegantWindow() @@ -52,6 +55,7 @@ namespace Deedy.Testing } public ElegantWindow() : base() { + } public override void OnApplyTemplate() { diff --git a/DeedyDesigner/Deedy.Testing/ExMarkup.cs b/DeedyDesigner/Deedy.Testing/ExMarkup.cs index 9dccdca..a4d0a31 100644 --- a/DeedyDesigner/Deedy.Testing/ExMarkup.cs +++ b/DeedyDesigner/Deedy.Testing/ExMarkup.cs @@ -53,34 +53,5 @@ namespace Deedy else throw new InvalidOperationException("窗体装饰器[WindowDecorator]对象只能附加到作为标题栏容器的[Decorator]类型派生对象(例如[Border]对象)上!"); } })); - - - - public static string GetTextBoxRegexMatch(DependencyObject obj) - { - return (string)obj.GetValue(TextBoxRegexMatchProperty); - } - - public static void SetTextBoxRegexMatch(DependencyObject obj, string value) - { - obj.SetValue(TextBoxRegexMatchProperty, value); - } - - // Using a DependencyProperty as the backing store for TextBoxRegexMatch. This enables animation, styling, binding, etc... - public static readonly DependencyProperty TextBoxRegexMatchProperty = - DependencyProperty.RegisterAttached("TextBoxRegexMatch", typeof(string), typeof(ExMarkup), new PropertyMetadata("", (d, e) => - { - if (d is TextBox textBox) - { - if (!string.IsNullOrEmpty(e.NewValue as string) && string.IsNullOrEmpty(e.OldValue as string)) - { - //加事件监听逻辑 - } - if (string.IsNullOrEmpty(e.NewValue as string) && !string.IsNullOrEmpty(e.OldValue as string)) - { - //取消事件监听逻辑 - } - } - })); } } diff --git a/DeedyDesigner/Deedy.Testing/MainWindow.xaml b/DeedyDesigner/Deedy.Testing/MainWindow.xaml index fb57713..1865e98 100644 --- a/DeedyDesigner/Deedy.Testing/MainWindow.xaml +++ b/DeedyDesigner/Deedy.Testing/MainWindow.xaml @@ -1,12 +1,21 @@ - - + + + + - + + + + + + + diff --git a/DeedyDesigner/Deedy.Testing/MainWindow.xaml.cs b/DeedyDesigner/Deedy.Testing/MainWindow.xaml.cs index 2a710e6..681e031 100644 --- a/DeedyDesigner/Deedy.Testing/MainWindow.xaml.cs +++ b/DeedyDesigner/Deedy.Testing/MainWindow.xaml.cs @@ -9,7 +9,7 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; -namespace Deedy.Testing +namespace Deedy { /// /// Interaction logic for MainWindow.xaml diff --git a/DeedyDesigner/Deedy.Testing/Themes/Generic.xaml b/DeedyDesigner/Deedy.Testing/Themes/Generic.xaml index 56134d0..b647568 100644 --- a/DeedyDesigner/Deedy.Testing/Themes/Generic.xaml +++ b/DeedyDesigner/Deedy.Testing/Themes/Generic.xaml @@ -1,7 +1,7 @@