Skip to content

Class StateBehaviorFactory

Definition

Namespace: StardewUI.Framework.Behaviors
Assembly: StardewUI.dll

Factory for creating behaviors that apply single-property overrides on state transitions, such as hover:transform.

public class StateBehaviorFactory : 
    StardewUI.Framework.Behaviors.IBehaviorFactory

Inheritance
Object ⇦ StateBehaviorFactory

Implements
IBehaviorFactory

Remarks

Also handles transitions, which follow a similar creation mechanism.

Members

Constructors

Name Description
StateBehaviorFactory()

Methods

Name Description
CanCreateBehavior(string, string) Checks if the factory can create behaviors with a specified name and argument.
CreateBehavior(Type, string, string) Creates a new behavior.

Details

Constructors

StateBehaviorFactory()

public StateBehaviorFactory();

Methods

CanCreateBehavior(string, string)

Checks if the factory can create behaviors with a specified name and argument.

public bool CanCreateBehavior(string name, string argument);
Parameters

name   string
The behavior name.

argument   string
The argument for the behavior, if any. Most implementations can ignore this parameter, but in some cases it is used for disambiguation.

Returns

Boolean

true if this factory should handle the specified name, when given the specified argument, otherwise false.


CreateBehavior(Type, string, string)

Creates a new behavior.

public StardewUI.Framework.Behaviors.IViewBehavior CreateBehavior(System.Type viewType, string name, string argument);
Parameters

viewType   Type
The specific type of IView that will receive the behavior.

name   string
The behavior name that specifies the type of behavior.

argument   string
Additional argument provided in the markup, distinct from the behavior's DataType. Enables prefixed behaviors such as tween:opacity

Returns

IViewBehavior

A new behavior of a type corresponding to the name.