Class VisualState
Represents a single state within a VisualStateGroup, and the property values it sets while its State flags are active.
[MarkupSetterCollection("Setters")]
public class VisualState
- Inheritance
-
VisualState
- Derived
- Inherited Members
- Extension Methods
Constructors
VisualState(ControlState)
Represents a single state within a VisualStateGroup, and the property values it sets while its State flags are active.
public VisualState(ControlState state)
Parameters
stateControlStateThe combination of ControlState flags this state responds to.
Properties
Duration
Gets or sets how long entering this state takes to animate each setter from the element's current effective value to its target, or null to snap instantly (the default).
public TimeSpan? Duration { get; set; }
Property Value
Easing
Gets or sets the easing function used for the transition when Duration is set. Ignored when Duration is null.
public EasingFunction? Easing { get; set; }
Property Value
Name
Gets the optional name of this state.
public string? Name { get; init; }
Property Value
Remarks
A label for people reading the style, the design tools and diagnostics. Unlike Name, it doesn't affect which state is active: that's decided by State alone.
Setters
Gets the property values this state sets while active, keyed by property name.
public Dictionary<string, object?> Setters { get; }
Property Value
State
Gets the combination of ControlState flags this state responds to.
public ControlState State { get; }
Property Value
Remarks
An element's ControlState can have more than one ControlState flag set at once (e.g. hovered and focused). Within a group, the state whose flags form the largest subset of the element's current ControlState is the one that becomes active; between equally large matches, the one declared last wins. See RegisterStateGroup(VisualStateGroup).