Hi,
news.microsoft.com said:
I have a struct but I have properties in that struct public and I want them
to be visible in the designer for a user control
so I have a property of SomeItem.Name, SomeItem.Value blah blah
how can I retain that tree in the designer property window?
I don't think this works for structs. If you have a property which exposes
a struct, then this struct is given by value (copy). Assume that there is a
property SomeItem, which returns a struct, then you cannot simply modify the
members of this struct:
e.g. MyUsercontrol.SomeItem.Name = "Test"; will not work... You're trying to
change a tempory copy.
Now, with classes/objects this works fine.
Before the property that exposes an object, put:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
And before the class which you return an object of, put:
[TypeConverterAttribute(typeof(System.ComponentModel.ExpandableObjectConvert
er))]
The IDE only expands/persists the public properties.
HTH
greetings
---