Resolves a document or style property from its local value, applicable styles, parent elements, or default.
Definition
Namespace:Telerik.WinForms.Documents.Model.Styles
Assembly:Telerik.WinControls.RichTextEditor.dll
Type Parameters:
TValue
The property's value type.
TPropertyContainer
The properties container that owns the property.
Syntax:
public class StyleProperty<TValue, TPropertyContainer> : StylePropertyBase where TPropertyContainer : DocumentElementPropertiesBase
Inheritance: objectStylePropertyBaseStyleProperty<TValue, TPropertyContainer>
Derived Classes:
Constructors
Creates and registers a property instance in its owning properties container.
public StyleProperty(TPropertyContainer propertyContainer, StylePropertyDefinition<TValue, TPropertyContainer> propertyDefinition)
The container that owns this property.
propertyDefinitionStylePropertyDefinition<TValue, TPropertyContainer>The definition used to identify and resolve the property.
Properties
PropertyContainer
TPropertyContainer
Gets the properties container that owns this property instance.
public TPropertyContainer PropertyContainer { get; }
Gets the definition that supplies this property's identity, default value, and layout options.
public override IStylePropertyDefinition PropertyDefinition { get; }
Overrides:
Gets the source currently used to resolve the effective value.
public override RadValueSource ValueSource { get; }
Overrides:
Methods
Re-evaluates the effective value when a changed source can affect it and notifies listeners if it differs.
protected void CheckForValueChange(RadValueSource changedValueSource)
The source whose value or relationship has changed.
Removes the local assignment when one is active, allowing style, parent, or default resolution to resume.
public override void ClearValue()
Overrides:
Allows a derived property to provide a parent value not covered by the standard style lookup.
protected virtual TValue GetLocalParentValueOverride()
TValue
The parent value supplied by the derived property, or the type's default value when there is no override.
Resolves the value from a local assignment, an applicable style, parent elements, or the definition's default.
public TValue GetValue()
TValue
The effective property value.
Gets the effective value, substituting the definition's default when the resolved value is null.
public TValue GetValueOrDefault()
TValue
The resolved value or the property's default value.
Notifies the owning document element or style after the effective value changes.
protected virtual void OnPropertyValueChanged(TValue oldValue, TValue newValue)
The previously resolved value.
newValueTValueThe newly resolved value.
Assigns a local value; a non-null value takes precedence over values supplied by styles and parent elements.
public void SetValue(TValue value)
The value to assign.