Theme Settings in InfoSet

Topics: Writing modules, Writing themes
May 13, 2014 at 3:08 AM
I'm updating my themes to use InfoSet instead of migrations and have a question regarding setting default values when the "record" is created.

Previously when using migrations, the following code:
    public class ThemeSettingsRecord {
        public ThemeSettingsRecord() {
            this.Skin = Constants.SkinDefault;
        }

        public virtual int Id { get; set; }
        public virtual string Skin { get; set; }
        public virtual bool UseHoverMenus { get; set; }
    }
would set the value of Skin to what I defined in Constants.SkinDefault. I have converted this code to use InfoSet with the following:
    public class ThemeSettingsPart : ContentPart {
        public string Skin {
            get { return this.Retrieve(r => r.Skin); }
            set { this.Store(r => r.Skin, value); }
        }
        public bool UseHoverMenus {
            get { return this.Retrieve(r => r.UseHoverMenus); }
            set { this.Store(r => r.UseHoverMenus, value); }
        }
    }
Am I still able to set the default value to Contants.SkinDefault? Can anyone show me what that would like like?

Thanks for the assistance =)
May 13, 2014 at 3:41 AM
May have found it...is it
get { return this.Retrieve(r => r.Skin, Constants.SkinDefault); }