Class GoToStateAction
An action that will transition a FrameworkElement to a specified VisualState when invoked.
public class GoToStateAction : TargetedTriggerAction<FrameworkElement>, IAnimatable, IAttachedObject
- Inheritance
-
GoToStateAction
- Implements
- Inherited Members
- Extension Methods
Remarks
If the TargetName property is set, this action will attempt to change the state of the targeted element. If not, it walks the element tree in an attempt to locate an alternative target that defines states. ControlTemplate and UserControl are two common possibilities.
Fields
StateNameProperty
public static readonly DependencyProperty StateNameProperty
Field Value
UseTransitionsProperty
public static readonly DependencyProperty UseTransitionsProperty
Field Value
Properties
StateName
The name of the VisualState.
public string StateName { get; set; }
Property Value
UseTransitions
Determines whether or not to use a VisualTransition to transition between states.
public bool UseTransitions { get; set; }
Property Value
Methods
Invoke(object)
This method is called when some criteria is met and the action is invoked.
protected override void Invoke(object parameter)
Parameters
parameter
object
Exceptions
- InvalidOperationException
Could not change the target to the specified StateName.
OnTargetChanged(FrameworkElement, FrameworkElement)
Called when the target changes. If the TargetName property isn't set, this action has custom behavior.
protected override void OnTargetChanged(FrameworkElement oldTarget, FrameworkElement newTarget)
Parameters
oldTarget
FrameworkElementnewTarget
FrameworkElement
Exceptions
- InvalidOperationException
Could not locate an appropriate FrameworkElement with states.