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 的根項目。

例外狀況

stateGroupsRootnull

-或-

newStatenull

備註

VisualStateGroup在 控制項的 上 ControlTemplate 設定 時, control 參數會設定為擁有 的 ControlTemplate 控制項。 VisualStateGroup在 上 FrameworkElement 設定 時, controlnull ,而且您應該使用 stateGroupsRoot 參數。

給繼承者的注意事項

在衍生類別中覆 RaiseCurrentStateChanging(VisualStateGroup, VisualState, VisualState, FrameworkElement, FrameworkElement) 寫時,請務必呼叫基類的 RaiseCurrentStateChanging(VisualStateGroup, VisualState, VisualState, FrameworkElement, FrameworkElement) 方法,讓已註冊的委派接收事件。

適用於