Custom control property fails to persist at design time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a custom treeview control that has property persistant problem at
design time. I tested with the following successful/failed senarios.

1) Added simple type properties.
That shows up with other properties at design time and I can also set
those at design time that is persisted properly.
2) Added a property P1 of class type T1. That class is just made up of two
int properties In1 and In2. get and set are there for P1, In1 and In2.
At design time P1 shows up in properties but is grayed out.
3) Modified case 2): If I make P1 an array of T1 then it shows up in
properties and is active with an epsilon button. Click on and I can set the
properties In1 and In2. But that is not saved. It does not persis.

I read somewhere that if a property is of complex type one has to use
ShouldPersist<propertyName>. I cannot figure out how can I make it persist.
Help Please !
 
I forgot to mention that I also tried with
[ DesignerSerializationVisibility(DesignerSerializationVisibility.Content)
]
 
Back
Top