Redigera

Dela via


VisualStateManager.RaiseCurrentStateChanged Method

Definition

Raises the CurrentStateChanging event on the specified VisualStateGroup object.

protected:
 void RaiseCurrentStateChanged(System::Windows::VisualStateGroup ^ stateGroup, System::Windows::VisualState ^ oldState, System::Windows::VisualState ^ newState, System::Windows::FrameworkElement ^ control, System::Windows::FrameworkElement ^ stateGroupsRoot);
protected void RaiseCurrentStateChanged (System.Windows.VisualStateGroup stateGroup, System.Windows.VisualState oldState, System.Windows.VisualState newState, System.Windows.FrameworkElement control, System.Windows.FrameworkElement stateGroupsRoot);
member this.RaiseCurrentStateChanged : System.Windows.VisualStateGroup * System.Windows.VisualState * System.Windows.VisualState * System.Windows.FrameworkElement * System.Windows.FrameworkElement -> unit
Protected Sub RaiseCurrentStateChanged (stateGroup As VisualStateGroup, oldState As VisualState, newState As VisualState, control As FrameworkElement, stateGroupsRoot As FrameworkElement)

Parameters

stateGroup
VisualStateGroup

The object that the CurrentStateChanging event occurred on.

oldState
VisualState

The state that the control is transitioning from.

newState
VisualState

The state that the control is transitioning to.

control
FrameworkElement

The control that is transitioning states.

stateGroupsRoot
FrameworkElement

The root element that contains the VisualStateManager.

Exceptions

stateGroupsRoot is null.

-or-

newState is null.

Remarks

When the VisualStateGroup is set on the ControlTemplate of a control, the control parameter is set to the control that owns ControlTemplate. When the VisualStateGroup is set on a FrameworkElement, control is null and you should use the stateGroupsRoot parameter.

Notes to Inheritors

When overriding RaiseCurrentStateChanged(VisualStateGroup, VisualState, VisualState, FrameworkElement, FrameworkElement) in a derived class, be sure to call the base class' RaiseCurrentStateChanged(VisualStateGroup, VisualState, VisualState, FrameworkElement, FrameworkElement) method so that registered delegates receive the event.

Applies to