1
Vote

PTB 2.0 Suggestion - Set Default Values of items within a PropertyGroup

description

I came across a situation today where PTB Property Groups would be very useful, if not for one minor limitation...
 
Essentially, I have a PropertyGroup I would like to use in several areas:
 
public class ProductInformationTab : PageTypePropertyGroup 
{ 
    [PageTypeProperty(UniqueValuePerLanguage = true, EditCaption = "Enable Tab", Type = typeof(PropertyBoolean), DefaultValue = true, DefaultValueType = DefaultValueType.Value)] 
    public virtual bool TabEnable { get; set; } 
 
    [PageTypeProperty(UniqueValuePerLanguage = true, EditCaption = "Tab Title", Type = typeof(PropertyString), DefaultValue = "Features", DefaultValueType = DefaultValueType.Value)] 
    public virtual String TabTitle { get; set; } 
 
} 
 
The problem arises when I want the default value of my first two properties to be something else..what if I want the tab to be enabled in some situations by default and in others not be enabled? Or if I wanted the TabTitle to be "Specifications" instead of "Features" ?
 
It would be nice if, when adding the PageTypePropertyGroup to the page, I could override the property attributes of certain PageTypeProperty elements..something like the following:
 
    [PageTypePropertyGroup(Tab=typeof(Features), Override=(PageTypeProperty(TabEnable.DefaultValue = false), PageTypeProperty(TabTitle.DefaultValue)="Specifications")] 
    public virtual ProductInformationTab Features { get; set; } 
 
I think this would make PageTypePropertyGroups a bit more useful...at least in my particular application.

comments