Why SomeClass.ClassField.StructField
property doesn't change in a propertyGrid
?
It seems, propertyGrid
doesn't call SomeClass.ClassField.set
after SomeStruct
instance has been changed. But same code works well with Point
instead of SomeStruct
.
[TypeConverter(typeof(ExpandableObjectConverter))]
public struct SomeStruct
{
private int structField;
public int StructField
{
get
{
return structField;
}
set
{
structField = value;
}
}
public override string ToString()
{
return "StructField: " + StructField;
}
}
[TypeConverter(typeof(ExpandableObjectConverter))]
public sealed class SomeClass
{
public SomeStruct ClassField
{
get;
set;
}
}
...
var someClass = new SomeClass
{
ClassField = new SomeStruct
{
StructField = 42
}
};
propertyGrid.SelectedObject = someClass;