/// <summary> /// Registers a new DotVVM property which fallbacks to the <paramref name="fallbackProperty" /> when not set. /// </summary> /// <param name="propertyName">The name of the property.</param> /// <param name="fallbackProperty">The property which value will be used as a follback when the new property is not set.</param> /// <param name="isValueInherited">Indicates whether the value can be inherited from the parent controls.</param> public static DotvvmPropertyWithFallback Register <TPropertyType, TDeclaringType>(string propertyName, DotvvmProperty fallbackProperty, bool isValueInherited = false) { var property = new DotvvmPropertyWithFallback { FallbackProperty = fallbackProperty }; return(Register <TPropertyType, TDeclaringType>(propertyName, isValueInherited: isValueInherited, property: property) as DotvvmPropertyWithFallback); }
/// <summary> /// Registers the specified DotVVM property. /// </summary> public static DotvvmPropertyWithFallback Register <TPropertyType, TDeclaringType>(string propertyName, DotvvmProperty defaultProperty, bool defaultPropertyInherit, bool isValueInherited = false) { var property = new DotvvmPropertyWithFallback() { DefaultProperty = defaultProperty, DefaultPropertyInherit = defaultPropertyInherit }; return(DotvvmProperty.Register <TPropertyType, TDeclaringType>(propertyName, isValueInherited: isValueInherited, property: property) as DotvvmPropertyWithFallback); }