diff --git a/src/Directory.Build.Props b/src/Directory.Build.Props index 7afc4ff0..f9bf59c1 100644 --- a/src/Directory.Build.Props +++ b/src/Directory.Build.Props @@ -1,9 +1,9 @@ true - 2.5.0.1 - 2.5.0.1 - 2.5.0.1 + 3.0.0.0 + 3.0.0.0 + 3.0.0.0 8.0 Copyright © HandyOrg 2018-2020 HandyOrg diff --git a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj index 81d86893..c3b5331e 100644 --- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj +++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj @@ -313,6 +313,9 @@ Resources\Img\LeftMainContent\RadioButton_16x.png + + Resources\Img\LeftMainContent\PropertyGridEditorPart_16x.png + Resources\Img\LeftMainContent\RepeatButton_16x.png diff --git a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj index 36014284..f03fb5a0 100644 --- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj +++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj @@ -313,6 +313,9 @@ Resources\Img\LeftMainContent\RadioButton_16x.png + + Resources\Img\LeftMainContent\PropertyGridEditorPart_16x.png + Resources\Img\LeftMainContent\RepeatButton_16x.png diff --git a/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj b/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj index ef64a679..f17655ca 100644 --- a/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj +++ b/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj @@ -177,6 +177,9 @@ UserControl\Controls\ProgressButtonDemoCtl.xaml + + UserControl\Controls\PropertyGridDemoCtl.xaml + UserControl\Controls\RangeSliderDemoCtl.xaml @@ -572,6 +575,10 @@ UserControl\Controls\ProgressButtonDemoCtl.xaml.cs ProgressButtonDemoCtl.xaml + + UserControl\Controls\PropertyGridDemoCtl.xaml.cs + PropertyGridDemoCtl.xaml + UserControl\Controls\RangeSliderDemoCtl.xaml.cs RangeSliderDemoCtl.xaml diff --git a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json index e69dda21..7ee1eeb7 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json +++ b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json @@ -40,6 +40,7 @@ "selectedIndex": 0, "demoItemList": [ [ "FloatingBlock", "FloatingBlockDemoCtl", "thumbs_up", "" ], + [ "PropertyGrid", "PropertyGridDemoCtl", "PropertyGridEditorPart_16x", "1" ], [ "ImageBlock", "ImageBlockDemoCtl", "ImageStack_16x", "" ], [ "Magnifier", "MagnifierDemoCtl", "Search_16x", "" ], [ "Gravatar", "GravatarDemoCtl", "User_16x", "" ], @@ -55,7 +56,7 @@ [ "TextBox", "TextBoxDemoCtl", "TextBox_16x", "" ], [ "ComboBox", "ComboBoxDemoCtl", "ComboBox_16x", "" ], [ "PasswordBox", "PasswordBoxDemoCtl", "PasswordBox_16x", "" ], - [ "PinBox", "PinBoxDemoCtl", "Ellipsis_16x", "1" ], + [ "PinBox", "PinBoxDemoCtl", "Ellipsis_16x", "" ], [ "DatePicker", "DatePickerDemoCtl", "DatePicker_16x", "" ], [ "Clock", "ClockDemoCtl", "Time_color_16x", "" ], [ "TimePicker", "TimePickerDemoCtl", "TimePicker_16x", "" ], diff --git a/src/Shared/HandyControlDemo_Shared/Data/Model/PropertyGridDemoModel.cs b/src/Shared/HandyControlDemo_Shared/Data/Model/PropertyGridDemoModel.cs new file mode 100644 index 00000000..f68bcb6e --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/Data/Model/PropertyGridDemoModel.cs @@ -0,0 +1,25 @@ +using System.ComponentModel; + +namespace HandyControlDemo.Data +{ + public class PropertyGridDemoModel + { + [Category("Info")] + public string Name { get; set; } + + [Category("Achievement")] + public int Score { get; set; } + + [Category("Achievement")] + public bool IsPassed { get; set; } + + [Category("Info")] + public Gender Gender { get; set; } + } + + public enum Gender + { + Male, + Female + } +} \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems index b28427b0..27573381 100644 --- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems +++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems @@ -19,6 +19,7 @@ + @@ -84,6 +85,9 @@ PinBoxDemoCtl.xaml + + PropertyGridDemoCtl.xaml + RangeSliderDemoCtl.xaml @@ -548,6 +552,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs index eb2498b4..d6b6456b 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs @@ -1337,7 +1337,18 @@ namespace HandyControlDemo.Properties.Langs { return ResourceManager.GetString("Project", resourceCulture); } } - + + /// + /// 查找类似 属性编辑器 的本地化字符串。 + /// + public static string PropertyGrid + { + get + { + return ResourceManager.GetString("PropertyGrid", resourceCulture); + } + } + /// /// 查找类似 按住说话 的本地化字符串。 /// diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx index 324db1ca..0f8f8540 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx @@ -750,4 +750,7 @@ Looks up a localized string similar to "{0}". + + PropertyGrid + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx index 75ebfd5d..f176e3e2 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx @@ -750,4 +750,7 @@ Looks up a localized string similar to "{0}". + + PropertyGrid + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx index 8e17aff4..1f15b560 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx @@ -750,4 +750,7 @@ Looks up a localized string similar to "{0}". + + PropertyGrid + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx index f3f49253..fe9f13ee 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx @@ -750,4 +750,7 @@ Looks up a localized string similar to "{0}". + + PropertyGrid + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx index 455582c2..e876c1bc 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx @@ -750,4 +750,7 @@ 查找类似 {0} 的本地化字符串。 + + 属性编辑器 + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx index 324db1ca..0f8f8540 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx @@ -750,4 +750,7 @@ Looks up a localized string similar to "{0}". + + PropertyGrid + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx index f7354d30..f0fb5b5c 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx @@ -750,4 +750,7 @@ Looks up a localized string similar to "{0}". + + PropertyGrid + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs index 5dd7cb48..e031d4b3 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs @@ -179,7 +179,8 @@ namespace HandyControlDemo.Properties.Langs OnPropertyChanged(nameof(ProgressBar)); OnPropertyChanged(nameof(ProgressButton)); OnPropertyChanged(nameof(Project)); - OnPropertyChanged(nameof(PushToTalk)); + OnPropertyChanged(nameof(PropertyGrid)); + OnPropertyChanged(nameof(PushToTalk)); OnPropertyChanged(nameof(QQGroup)); OnPropertyChanged(nameof(RadioButton)); OnPropertyChanged(nameof(RangeSlider)); @@ -960,6 +961,11 @@ namespace HandyControlDemo.Properties.Langs /// public string Project => Lang.Project; + /// + /// 查找类似 属性编辑器 的本地化字符串。 + /// + public string PropertyGrid => Lang.PropertyGrid; + /// /// 查找类似 按住说话 的本地化字符串。 /// @@ -2024,6 +2030,11 @@ namespace HandyControlDemo.Properties.Langs /// public static string Project = nameof(Project); + /// + /// 查找类似 属性编辑器 的本地化字符串。 + /// + public static string PropertyGrid = nameof(PropertyGrid); + /// /// 查找类似 按住说话 的本地化字符串。 /// diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/PropertyGridEditorPart_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/PropertyGridEditorPart_16x.png new file mode 100644 index 00000000..09bdd02d Binary files /dev/null and b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/PropertyGridEditorPart_16x.png differ diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PropertyGridDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PropertyGridDemoCtl.xaml new file mode 100644 index 00000000..72a917de --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PropertyGridDemoCtl.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PropertyGridDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PropertyGridDemoCtl.xaml.cs new file mode 100644 index 00000000..4cf3e692 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PropertyGridDemoCtl.xaml.cs @@ -0,0 +1,30 @@ +using System.Windows; +using HandyControlDemo.Data; + +namespace HandyControlDemo.UserControl +{ + public partial class PropertyGridDemoCtl + { + public PropertyGridDemoCtl() + { + InitializeComponent(); + + DemoModel = new PropertyGridDemoModel + { + Name = "TestName", + Gender = Gender.Female, + IsPassed = true, + Score = 98 + }; + } + + public static readonly DependencyProperty DemoModelProperty = DependencyProperty.Register( + "DemoModel", typeof(PropertyGridDemoModel), typeof(PropertyGridDemoCtl), new PropertyMetadata(default(PropertyGridDemoModel))); + + public PropertyGridDemoModel DemoModel + { + get => (PropertyGridDemoModel) GetValue(DemoModelProperty); + set => SetValue(DemoModelProperty, value); + } + } +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DatePropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DatePropertyEditor.cs new file mode 100644 index 00000000..50005ce5 --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DatePropertyEditor.cs @@ -0,0 +1,14 @@ +using System.Windows; + +namespace HandyControl.Controls +{ + public class DatePropertyEditor : PropertyEditorBase + { + public override FrameworkElement CreateElement(PropertyItem propertyItem) => new DateTimePicker + { + IsEnabled = !propertyItem.IsReadOnly + }; + + public override DependencyProperty GetDependencyProperty() => System.Windows.Controls.DatePicker.SelectedDateProperty; + } +} \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DateTimePropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DateTimePropertyEditor.cs new file mode 100644 index 00000000..34e32e6b --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/DateTimePropertyEditor.cs @@ -0,0 +1,14 @@ +using System.Windows; + +namespace HandyControl.Controls +{ + public class DateTimePropertyEditor : PropertyEditorBase + { + public override FrameworkElement CreateElement(PropertyItem propertyItem) => new DateTimePicker + { + IsEnabled = !propertyItem.IsReadOnly + }; + + public override DependencyProperty GetDependencyProperty() => DateTimePicker.SelectedDateTimeProperty; + } +} \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/EnumPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/EnumPropertyEditor.cs new file mode 100644 index 00000000..bb5ec065 --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/EnumPropertyEditor.cs @@ -0,0 +1,17 @@ +using System; +using System.Windows; +using System.Windows.Controls.Primitives; + +namespace HandyControl.Controls +{ + public class EnumPropertyEditor : PropertyEditorBase + { + public override FrameworkElement CreateElement(PropertyItem propertyItem) => new System.Windows.Controls.ComboBox + { + IsEnabled = !propertyItem.IsReadOnly, + ItemsSource = Enum.GetValues(propertyItem.PropertyType) + }; + + public override DependencyProperty GetDependencyProperty() => Selector.SelectedValueProperty; + } +} \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/IntegerPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/IntegerPropertyEditor.cs new file mode 100644 index 00000000..bd48007b --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/IntegerPropertyEditor.cs @@ -0,0 +1,31 @@ +using System.Windows; + +namespace HandyControl.Controls +{ + public class NumberPropertyEditor : PropertyEditorBase + { + public NumberPropertyEditor(double minimum, double maximum) + { + Minimum = minimum; + Maximum = maximum; + } + + public double Minimum { get; set; } + + public double Maximum { get; set; } + + public override FrameworkElement CreateElement(PropertyItem propertyItem) + { + var numericUpDown = new NumericUpDown + { + IsReadOnly = propertyItem.IsReadOnly, + Minimum = Minimum, + Maximum = Maximum + }; + + numericUpDown.SetBinding(NumericUpDown.ValueProperty, CreateBinding(propertyItem)); + + return numericUpDown; + } + } +} \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/NumberPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/NumberPropertyEditor.cs new file mode 100644 index 00000000..bde1fd84 --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/NumberPropertyEditor.cs @@ -0,0 +1,31 @@ +using System.Windows; + +namespace HandyControl.Controls +{ + public class NumberPropertyEditor : PropertyEditorBase + { + public NumberPropertyEditor() + { + + } + + public NumberPropertyEditor(double minimum, double maximum) + { + Minimum = minimum; + Maximum = maximum; + } + + public double Minimum { get; set; } + + public double Maximum { get; set; } + + public override FrameworkElement CreateElement(PropertyItem propertyItem) => new NumericUpDown + { + IsReadOnly = propertyItem.IsReadOnly, + Minimum = Minimum, + Maximum = Maximum + }; + + public override DependencyProperty GetDependencyProperty() => NumericUpDown.ValueProperty; + } +} \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PlainTextPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PlainTextPropertyEditor.cs new file mode 100644 index 00000000..7782e114 --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PlainTextPropertyEditor.cs @@ -0,0 +1,14 @@ +using System.Windows; + +namespace HandyControl.Controls +{ + public class PlainTextPropertyEditor : PropertyEditorBase + { + public override FrameworkElement CreateElement(PropertyItem propertyItem) => new System.Windows.Controls.TextBox + { + IsReadOnly = propertyItem.IsReadOnly + }; + + public override DependencyProperty GetDependencyProperty() => System.Windows.Controls.TextBox.TextProperty; + } +} \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PropertyEditorBase.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PropertyEditorBase.cs new file mode 100644 index 00000000..42a7a360 --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/PropertyEditorBase.cs @@ -0,0 +1,28 @@ +using System.Windows; +using System.Windows.Data; + +namespace HandyControl.Controls +{ + public abstract class PropertyEditorBase : FrameworkElement + { + public abstract FrameworkElement CreateElement(PropertyItem propertyItem); + + public virtual void CreateBinding(PropertyItem propertyItem, FrameworkElement element) => + BindingOperations.SetBinding(element, GetDependencyProperty(), + new Binding($"({propertyItem.PropertyName})") + { + Source = propertyItem.Value, + Mode = GetBindingMode(propertyItem), + UpdateSourceTrigger = GetUpdateSourceTrigger(propertyItem), + Converter = GetConverter(propertyItem) + }); + + public abstract DependencyProperty GetDependencyProperty(); + + public virtual BindingMode GetBindingMode(PropertyItem propertyItem) => propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay; + + public virtual UpdateSourceTrigger GetUpdateSourceTrigger(PropertyItem propertyItem) => UpdateSourceTrigger.PropertyChanged; + + protected virtual IValueConverter GetConverter(PropertyItem propertyItem) => null; + } +} \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ReadOnlyTextPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ReadOnlyTextPropertyEditor.cs new file mode 100644 index 00000000..e88f10d5 --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/ReadOnlyTextPropertyEditor.cs @@ -0,0 +1,20 @@ +using System.Windows; +using System.Windows.Data; +using HandyControl.Tools; + +namespace HandyControl.Controls +{ + public class ReadOnlyTextPropertyEditor : PropertyEditorBase + { + public override FrameworkElement CreateElement(PropertyItem propertyItem) => new System.Windows.Controls.TextBox + { + IsReadOnly = true + }; + + public override DependencyProperty GetDependencyProperty() => System.Windows.Controls.TextBox.TextProperty; + + public override BindingMode GetBindingMode(PropertyItem propertyItem) => BindingMode.OneWay; + + protected override IValueConverter GetConverter(PropertyItem propertyItem) => ResourceHelper.GetResource("Object2StringConverter"); + } +} \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/StringPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/StringPropertyEditor.cs new file mode 100644 index 00000000..77663d9b --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/StringPropertyEditor.cs @@ -0,0 +1,19 @@ +using System.Windows; + +namespace HandyControl.Controls +{ + public class PlainTextPropertyEditor : PropertyEditorBase + { + public override FrameworkElement CreateElement(PropertyItem propertyItem) + { + var textbox = new System.Windows.Controls.TextBox + { + IsReadOnly = propertyItem.IsReadOnly + }; + + textbox.SetBinding(System.Windows.Controls.TextBox.TextProperty, CreateBinding(propertyItem)); + + return textbox; + } + } +} \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/SwitchPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/SwitchPropertyEditor.cs new file mode 100644 index 00000000..fbfb1c4a --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/SwitchPropertyEditor.cs @@ -0,0 +1,18 @@ +using System.Windows; +using System.Windows.Controls.Primitives; +using HandyControl.Tools; + +namespace HandyControl.Controls +{ + public class SwitchPropertyEditor : PropertyEditorBase + { + public override FrameworkElement CreateElement(PropertyItem propertyItem) => new ToggleButton + { + Style = ResourceHelper.GetResource + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToolTipBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToolTipBaseStyle.xaml index 94a22dfe..0fdfeaf9 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToolTipBaseStyle.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToolTipBaseStyle.xaml @@ -1,6 +1,11 @@  + xmlns:controls="clr-namespace:HandyControl.Controls" + xmlns:themes="clr-namespace:HandyControl.Themes"> + + + +