语言

VisualStateManager.RaiseCurrentStateChanged 方法

定义

CurrentStateChanging对指定VisualStateGroup对象引发事件。

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)

参数

stateGroup
VisualStateGroup

事件发生的对象 CurrentStateChanging 。

oldState
VisualState

控件从中转换的状态。

newState
VisualState

控件正在转换到的状态。

control
FrameworkElement

正在转换状态的控件。

stateGroupsRoot
FrameworkElement

包含 .. 的 VisualStateManager根元素

例外

stateGroupsRoot 是 null。

-或-

newState 是 null。

注解

在控件上设置此参数VisualStateGroup时,参数ControlTemplate设置为拥有的controlControlTemplate控件。 VisualStateGroup在设置FrameworkElement时,control应null使用stateGroupsRoot参数。

继承者说明

在派生类中重写 RaiseCurrentStateChanged(VisualStateGroup, VisualState, VisualState, FrameworkElement, FrameworkElement) 时,请务必调用基类 RaiseCurrentStateChanged(VisualStateGroup, VisualState, VisualState, FrameworkElement, FrameworkElement) 的方法,以便已注册的委托接收事件。

适用于