I'm looking to make a set of properties be hidden/shown using the [+] button mechanics that the default Plot pen properties use for setting the properties of a plot.
I've been attempting to use ExpandableObjectConverter. Hiding/showing the properties/values is working fine. My problem is that the default values of the intval and boolval properties are used when clicking 'Apply' after changing the values in the property grid dialog. I'm trying to make the user-defined values persist after the indicator is applied.
Here's what I have so far:
TestClass testobj = new TestClass();
[TypeConverter(typeof(ExpandableObjectConverter))]
public class TestClass
{
private int intval = 4;
private bool boolval = false;
public int MyInt
{
get { return intval; }
set { intval = value; }
}
public bool MyBool
{
get { return boolval; }
set { boolval = value; }
}
public override string ToString() { return "test str"; }
}
[Description("Test property")]
[Category("Test Category")]
[Gui.Design.DisplayName("Testing")]
public TestClass TestProp
{
get { return testobj; }
}
Thanks for your help!
Comment