語言

VisualStateManager.RaiseCurrentStateChanging 方法

定義

在指定CurrentStateChanging物件上VisualStateGroup觸發事件。

protected:
 void RaiseCurrentStateChanging(System::Windows::VisualStateGroup ^ stateGroup, System::Windows::VisualState ^ oldState, System::Windows::VisualState ^ newState, System::Windows::FrameworkElement ^ control, System::Windows::FrameworkElement ^ stateGroupsRoot);
protected void RaiseCurrentStateChanging(System.Windows.VisualStateGroup stateGroup, System.Windows.VisualState oldState, System.Windows.VisualState newState, System.Windows.FrameworkElement control, System.Windows.FrameworkElement stateGroupsRoot);
member this.RaiseCurrentStateChanging : System.Windows.VisualStateGroup * System.Windows.VisualState * System.Windows.VisualState * System.Windows.FrameworkElement * System.Windows.FrameworkElement -> unit
Protected Sub RaiseCurrentStateChanging (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 ,參數 control 會被設定為擁有 ControlTemplate的控制點。 當 設定VisualStateGroup在 時FrameworkElement,是 control ,null你應該使用參數stateGroupsRoot。

給繼承者的注意事項

在導出類別中覆寫 RaiseCurrentStateChanging(VisualStateGroup, VisualState, VisualState, FrameworkElement, FrameworkElement) 時,務必呼叫基底類別的方法 RaiseCurrentStateChanging(VisualStateGroup, VisualState, VisualState, FrameworkElement, FrameworkElement) ,讓註冊代理接收事件。

適用於