PropertyGrid takes an action after editing with a UITypeEditor or TypeConverter to change another property

I have a class with some properties. After changing one of them, I want to react and change another property. This action should be performed by UITypeEditor or TypeConverter, and not by an event in the class itself.

I do not want to use INotifyPropertyChanged and handle this in the class itself.

untested code sample

public class MyEditor : UITypeEditor
{
    public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
    {
        // change the other property
    }
}

[Editor(typeof(MyEditor), typeof(UITypeEditor))]
class MyClass
{
    public string String1 { get; set; } 
    public string String2 { get; set; } 
    public string String3 { get; set; } 
}

This EditValue has only a modal editor display function with a small button ... But I want to have a normal text box with AfterChange or so.

+3
source share
1 answer

NotifyParentPropertyAttribute MSDN.
, BorderAppearance BorderAppearanceConverter. MyClassConverter, NotifyParentPropertyAttribute .

0

All Articles