Advertisement
I've got a class (we'll call it Settings) that inherits from Component. This gives me a "Settings" object I can drop onto a page, which will place it in the bottom tray area where things like DataAdapters normally go.
Settings contains properties that are used by various Controls on the page. Those controls each have a property named SettingsControl of type Settings. This gives me a "SettingsControl" property in the designer for those Controls, which has a drop-down of all Settings objects currently on the page. When I select an item from the drop-down, the SettingsControl property becomes expandable with the properties of that instance of Settings. It also changes the html of the page so the Control has a "SettingsControl='mySettingsControl'" property. Awesome.
Here's the catch... if I close the page that contains these Controls, then re-open it in the designer, the Controls no longer indicate that they have been assigned a value. They all say "(None)" as if they were set to null. Interestingly, if I switch to HTML view, the "SettingsControl='mySettingsControl'" properties are all still set on each Control. It seems like something is wrong with my "get" method, but I can't imagine what. Here's the property on each of the Controls:
[Bindable(false),
Category("Misc"),
Description(""),
ParenthesizePropertyName(true)]
public Settings SettingsControl
{
get {return sharedSettings;}
set {sharedSettings = value;}
}
private Settings sharedSettings = null;
I've tried setting Bindable to true and I've tried the method that worked for my previous issue with expandable properties. So far nothing has been successful and I haven't been able to find anything useful online anywhere.
Any help would be very greatly appreciated. Naturally, if I find the solution on my own or give up, I'll make a post stating as such, so if this is still sitting here with no answer, I'm still trying to figure it out. :)
Settings contains properties that are used by various Controls on the page. Those controls each have a property named SettingsControl of type Settings. This gives me a "SettingsControl" property in the designer for those Controls, which has a drop-down of all Settings objects currently on the page. When I select an item from the drop-down, the SettingsControl property becomes expandable with the properties of that instance of Settings. It also changes the html of the page so the Control has a "SettingsControl='mySettingsControl'" property. Awesome.
Here's the catch... if I close the page that contains these Controls, then re-open it in the designer, the Controls no longer indicate that they have been assigned a value. They all say "(None)" as if they were set to null. Interestingly, if I switch to HTML view, the "SettingsControl='mySettingsControl'" properties are all still set on each Control. It seems like something is wrong with my "get" method, but I can't imagine what. Here's the property on each of the Controls:
[Bindable(false),
Category("Misc"),
Description(""),
ParenthesizePropertyName(true)]
public Settings SettingsControl
{
get {return sharedSettings;}
set {sharedSettings = value;}
}
private Settings sharedSettings = null;
I've tried setting Bindable to true and I've tried the method that worked for my previous issue with expandable properties. So far nothing has been successful and I haven't been able to find anything useful online anywhere.
Any help would be very greatly appreciated. Naturally, if I find the solution on my own or give up, I'll make a post stating as such, so if this is still sitting here with no answer, I'm still trying to figure it out. :)
Advertisement
Advertisement