I have a custom Property Grid editor, and the data context of the control is being overwritten, which causes issues with viewmodels, etc.
Example:
Is this intentional behaviour?
Example:
public class MyCustomEditor : ITypeEditor
{
public FrameworkElement ResolveEditor(PropertyItem propertyItem)
{
var button = new Button();
button.DataContext = "example";
button.DataContextChanged += (sender, args) => {Console.WriteLine("Data context changed!"); };
return button;
}
}
The event will trigger after the Property Grid loads the editor, overwriting the initial data context.Is this intentional behaviour?