New to Telerik UI for WinForms? Start a free 30-day trial

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:

C#
public class StyleProperty<TValue, TPropertyContainer> : StylePropertyBase where TPropertyContainer : DocumentElementPropertiesBase

Inheritance: objectStylePropertyBaseStyleProperty<TValue, TPropertyContainer>

Derived Classes: ListIdPropertyTableCellTextAlignmentProperty

Constructors

Creates and registers a property instance in its owning properties container.

C#
public StyleProperty(TPropertyContainer propertyContainer, StylePropertyDefinition<TValue, TPropertyContainer> propertyDefinition)
Parameters:propertyContainerTPropertyContainer

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.

C#
public TPropertyContainer PropertyContainer { get; }

Gets the definition that supplies this property's identity, default value, and layout options.

C#
public override IStylePropertyDefinition PropertyDefinition { get; }

Overrides: StylePropertyBase.PropertyDefinition

Gets the source currently used to resolve the effective value.

C#
public override RadValueSource ValueSource { get; }

Overrides: StylePropertyBase.ValueSource

Methods

Re-evaluates the effective value when a changed source can affect it and notifies listeners if it differs.

C#
protected void CheckForValueChange(RadValueSource changedValueSource)
Parameters:changedValueSourceRadValueSource

The source whose value or relationship has changed.

Removes the local assignment when one is active, allowing style, parent, or default resolution to resume.

C#
public override void ClearValue()

Overrides: StylePropertyBase.ClearValue()

Allows a derived property to provide a parent value not covered by the standard style lookup.

C#
protected virtual TValue GetLocalParentValueOverride()
Returns:

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.

C#
public TValue GetValue()
Returns:

TValue

The effective property value.

Gets the effective value, substituting the definition's default when the resolved value is null.

C#
public TValue GetValueOrDefault()
Returns:

TValue

The resolved value or the property's default value.

Gets whether a non-null value was assigned directly to this property.

C#
public override bool HasLocalValue()
Returns:

bool

true when a local value is present; otherwise, false.

Overrides: StylePropertyBase.HasLocalValue()

Notifies the owning document element or style after the effective value changes.

C#
protected virtual void OnPropertyValueChanged(TValue oldValue, TValue newValue)
Parameters:oldValueTValue

The previously resolved value.

newValueTValue

The newly resolved value.

Assigns a local value; a non-null value takes precedence over values supplied by styles and parent elements.

C#
public void SetValue(TValue value)
Parameters:valueTValue

The value to assign.