StyleProperty

Description

[ShutdownSurvive]
sealed class Tinman.Engine.GUI.Styles.StyleProperty<T>

Derived from

IStyleProperty

A stylesheet property for a GUI component.

When the value of a stylesheet property is queried for a given Component via Get1, the following logic is applied in order to find the property value:

  1. Build a StyleClass value from Component.StyleClassType and Component.StyleClassVariant of the given Component.

  2. Make the given Component the current one.

  3. Make the built StyleClass value the current one.

  4. If the current Component has a Stylesheet, use Stylesheet.Get to retrieve the property value for the current StyleClass value, if it exists.

  5. If the property has not been found and StyleClass.SuperClass returns true, make the resulting StyleClass value the current one and continue with 4.

  6. If the property has not been found and Component.Parent does not return null, make the returned Component the current one and continue with 3.

  7. Return the stylesheet property value. Otherwise, return the default value of the property.

Public / Constructors

Style​Property


public constructor StyleProperty → (2)

name in : string

[not-empty]
The machine-friendly style property name.

defaultValue in : T

The default value of the style property.

Creates a new instance of StyleProperty.

Public / Methods

Get

3 overloads


[Pure]
public method Get1 → (1)

component in : Component

[not-null]
The component.

returns → T

The style property value.

Returns the value of this style property.


[Pure]
public method Get2 → (2)

component in : Component

[not-null]
The component.

defaultValue in : T

Custom default value to use.

returns → T

The style property value.

Returns the value of this style property.


[Pure]
public method Get3 → (3)

component in : Component

[not-null]
The component.

defaultValue in : T

Custom default value to use.

styleClass in : StyleClass

Custom style class to use.

returns → T

The style property value.

Returns the value of this style property.

Set

2 overloads


public method Set1 → (2)

component in : Component

[not-null]
The component.

value in : T

The style property value.

Sets the value of this style property.

This method uses StyleClass.Root.


public method Set2 → (3)

component in : Component

[not-null]
The component.

value in : T

The style property value.

styleClass in : StyleClass

The style class.

Sets the value of this style property.

Unset

2 overloads


public method Unset1 → (1)

component in : Component

[not-null]
The component.

Un-sets the value of this style property.

This method uses StyleClass.Root.


public method Unset2 → (2)

component in : Component

[not-null]
The component.

styleClass in : StyleClass

The style class.

Un-sets the value of this style property.