add PropertyGrid v1
This commit is contained in:
1 parent
dea3287619
commit
0660a60e27
12 files changed
+90
-22
No files matched your search
-3
@@ -1,5 +1,4 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
@@ -11,7 +10,5 @@ namespace HandyControl.Controls
|
||||
};
|
||||
|
||||
public override DependencyProperty GetDependencyProperty() => System.Windows.Controls.TextBox.TextProperty;
|
||||
|
||||
public override BindingMode GetBindingMode(PropertyItem propertyItem) => BindingMode.OneWay;
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace HandyControl.Controls
|
||||
Source = propertyItem.Value,
|
||||
Mode = GetBindingMode(propertyItem),
|
||||
UpdateSourceTrigger = GetUpdateSourceTrigger(propertyItem),
|
||||
Converter = GetConverter()
|
||||
Converter = GetConverter(propertyItem)
|
||||
});
|
||||
|
||||
public abstract DependencyProperty GetDependencyProperty();
|
||||
@@ -23,6 +23,6 @@ namespace HandyControl.Controls
|
||||
|
||||
public virtual UpdateSourceTrigger GetUpdateSourceTrigger(PropertyItem propertyItem) => UpdateSourceTrigger.PropertyChanged;
|
||||
|
||||
protected virtual IValueConverter GetConverter() => null;
|
||||
protected virtual IValueConverter GetConverter(PropertyItem propertyItem) => null;
|
||||
}
|
||||
}
|
||||
+3
@@ -1,5 +1,6 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
@@ -13,5 +14,7 @@ namespace HandyControl.Controls
|
||||
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<IValueConverter>("Object2StringConverter");
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
@@ -123,6 +124,8 @@ namespace HandyControl.Controls
|
||||
set => SetValue(IsExpandedEnabledProperty, value);
|
||||
}
|
||||
|
||||
public PropertyDescriptor PropertyDescriptor { get; set; }
|
||||
|
||||
public virtual void InitElement()
|
||||
{
|
||||
if (Editor == null) return;
|
||||
|
||||
Reference in new issue
Block a user