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 a4a7980a..bdb2f1da 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/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj b/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj index 936ec214..3d75fe2c 100644 --- a/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj +++ b/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj @@ -134,4 +134,7 @@ Resources\Images\GlowWindow\topright.png + + + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json index e69dda21..288b158d 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json +++ b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json @@ -39,6 +39,7 @@ "title": "Controls", "selectedIndex": 0, "demoItemList": [ + [ "PropertyGrid", "PropertyGridDemoCtl", "PropertyGridEditorPart_16x", "1" ], [ "FloatingBlock", "FloatingBlockDemoCtl", "thumbs_up", "" ], [ "ImageBlock", "ImageBlockDemoCtl", "ImageStack_16x", "" ], [ "Magnifier", "MagnifierDemoCtl", "Search_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/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems index b28427b0..6dc16fbe 100644 --- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems +++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems @@ -84,6 +84,9 @@ PinBoxDemoCtl.xaml + + PropertyGridDemoCtl.xaml + RangeSliderDemoCtl.xaml @@ -548,6 +551,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..37108e68 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PropertyGridDemoCtl.xaml @@ -0,0 +1,7 @@ + + + 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..adb77878 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PropertyGridDemoCtl.xaml.cs @@ -0,0 +1,10 @@ +namespace HandyControlDemo.UserControl +{ + public partial class PropertyGridDemoCtl + { + public PropertyGridDemoCtl() + { + InitializeComponent(); + } + } +} diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/BooleanPropertyEditor.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/BooleanPropertyEditor.cs new file mode 100644 index 00000000..4601d51c --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/Editors/BooleanPropertyEditor.cs @@ -0,0 +1,23 @@ +using System.Windows; +using System.Windows.Controls.Primitives; +using HandyControl.Tools; + +namespace HandyControl.Controls +{ + public class BooleanPropertyEditor : PropertyEditorBase + { + public override FrameworkElement CreateElement(PropertyItem propertyItem) + { + var button = new ToggleButton + { + Style = ResourceHelper.GetResource + + + + + + + + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/CustomAttributeExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/CustomAttributeExtension.cs new file mode 100644 index 00000000..f50c4d9e --- /dev/null +++ b/src/Shared/HandyControl_Shared/Tools/Extension/CustomAttributeExtension.cs @@ -0,0 +1,12 @@ +using System; +using System.Reflection; + +namespace HandyControl.Tools.Extension +{ + internal static class CustomAttributeExtension + { + public static Attribute GetCustomAttribute(this MemberInfo element, Type attributeType) => Attribute.GetCustomAttribute(element, attributeType); + + public static T GetCustomAttribute(this MemberInfo element) where T : Attribute => (T)GetCustomAttribute(element, typeof(T)); + } +} \ No newline at end of file