Hello,
I am trying to create a user control which allows the user to enter a
collection of items at design-time. Code example:
public class MyControl : System.Windows.Forms.UserControl
{
....
MyItem [] itemList;
public MyItem [] ItemList
{
get { return itemList; }
set { itemList = value; }
}
....
}
public class MyItem
{
private string caption;
public string Caption
{
get { return caption; }
set { caption = value; }
}
}
I want to add design-time support for ItemList property. Currently in
design mode Visual Studio opens Collection Editor for ItemList
property
and I can define all items but after clicking OK items are not saved
(they just disappear). I tried to use
[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
for ItemList property but it doesn't help. I also have implemented a
TypeConverter for ItemList which can make a convertion between
collection of items and string - but is also doesn't help. Maybe you
can
help me.
Regards,
Tomasz Siwarga