I have a control "template" (I'll call UserControlTemplate) that I inherit as the base type for several other similar controls, like below:
public class UserControl1 : UserControlTemplate
{...}
public class UserControl2 : UserControlTemplate
{...}
My problem is I need to allow access to a UserControlTemplate property I'll call UserProperty1, but I only want it to be visible to classes that inherit UserControlTemplate such as UserControl1 and UserControl2, but I also want the property to show up in the IDE's property window while designing the new controls that inherit the template.
If I use the following:
protected string UserProperty1
{
get{...}
set{...}
}
This property does not show up in the designer under the properties window. I don't want to set the property to public because I don't want it to be changed anytime other than when designing the inherited control. I did some reading on custom designers and shadowing, and after trying a few things, the property still does not show up in the IDE property window when I'm designing the inherited control. The property only shows up when I place the inherited control on a form and select the inherited control, but that's not what I'm after.
public class UserControl1 : UserControlTemplate
{...}
public class UserControl2 : UserControlTemplate
{...}
My problem is I need to allow access to a UserControlTemplate property I'll call UserProperty1, but I only want it to be visible to classes that inherit UserControlTemplate such as UserControl1 and UserControl2, but I also want the property to show up in the IDE's property window while designing the new controls that inherit the template.
If I use the following:
protected string UserProperty1
{
get{...}
set{...}
}
This property does not show up in the designer under the properties window. I don't want to set the property to public because I don't want it to be changed anytime other than when designing the inherited control. I did some reading on custom designers and shadowing, and after trying a few things, the property still does not show up in the IDE property window when I'm designing the inherited control. The property only shows up when I place the inherited control on a form and select the inherited control, but that's not what I'm after.