Persisting Property of userdefined Collection type.
-
Hi, I have exposed a property in a UserControl. The Property is of Collection type. ( Collection of my Userdefined type). When I use this Control in a Form, the Forms Designer allows me to Edit the property (MyValues) using the Default Collection Editor UI. But the Changes made to the Collection are not persisted in the Form code by the Forms Designer.
//------------------------------------
class MyControl : UserControl
{MyTypeCollection m_values = new MyTypeCollection();
public MyTypeCollection MyValues
{
get
{
return m_values ;
}
set
{
m_values = value;
}
}}
//------------------------------------
class MyTypeCollection : CollectionBase
{
Add(){...}
Remove(){...}
}//------------------------------------
class MyType
{
int i;
bool b;public int XXX
{
get
{
return i;
}
set
{
i= value;
}
}public bool YYY
{
get
{
return b;
}
set
{
b= value;
}
}}
How can I make the Forms Designer generate code for the Collection Modified at Design time. Please someone Help me... Zor
-
Hi, I have exposed a property in a UserControl. The Property is of Collection type. ( Collection of my Userdefined type). When I use this Control in a Form, the Forms Designer allows me to Edit the property (MyValues) using the Default Collection Editor UI. But the Changes made to the Collection are not persisted in the Form code by the Forms Designer.
//------------------------------------
class MyControl : UserControl
{MyTypeCollection m_values = new MyTypeCollection();
public MyTypeCollection MyValues
{
get
{
return m_values ;
}
set
{
m_values = value;
}
}}
//------------------------------------
class MyTypeCollection : CollectionBase
{
Add(){...}
Remove(){...}
}//------------------------------------
class MyType
{
int i;
bool b;public int XXX
{
get
{
return i;
}
set
{
i= value;
}
}public bool YYY
{
get
{
return b;
}
set
{
b= value;
}
}}
How can I make the Forms Designer generate code for the Collection Modified at Design time. Please someone Help me... Zor