VisualStateManager.GoToStateCore 메서드

정의

컨트롤을 상태 간에 전환합니다.

protected:
 virtual bool GoToStateCore(System::Windows::FrameworkElement ^ control, System::Windows::FrameworkElement ^ stateGroupsRoot, System::String ^ stateName, System::Windows::VisualStateGroup ^ group, System::Windows::VisualState ^ state, bool useTransitions);
protected virtual bool GoToStateCore (System.Windows.FrameworkElement control, System.Windows.FrameworkElement stateGroupsRoot, string stateName, System.Windows.VisualStateGroup group, System.Windows.VisualState state, bool useTransitions);
abstract member GoToStateCore : System.Windows.FrameworkElement * System.Windows.FrameworkElement * string * System.Windows.VisualStateGroup * System.Windows.VisualState * bool -> bool
override this.GoToStateCore : System.Windows.FrameworkElement * System.Windows.FrameworkElement * string * System.Windows.VisualStateGroup * System.Windows.VisualState * bool -> bool
Protected Overridable Function GoToStateCore (control As FrameworkElement, stateGroupsRoot As FrameworkElement, stateName As String, group As VisualStateGroup, state As VisualState, useTransitions As Boolean) As Boolean

매개 변수

control
FrameworkElement

상태 간에 전환할 컨트롤입니다.

stateGroupsRoot
FrameworkElement

VisualStateManager가 들어 있는 루트 요소입니다.

stateName
String

변환 후 상태 이름입니다.

group
VisualStateGroup

상태가 속한 VisualStateGroup입니다.

state
VisualState

변환 후 상태에 대한 표현입니다.

useTransitions
Boolean

VisualTransition 개체를 사용하여 상태를 전환하려면 true이고, 그렇지 않으면 false입니다.

반환

Boolean

컨트롤이 새 상태로 성공적으로 전환되면 true이고, 그렇지 않으면 false입니다.

설명

이 메서드는 GoToStateCore 전환과 연결된 스토리보드를 적절하게 시작하고 중지하는 데 필요한 논리를 수행합니다. 컨트롤이 상태를 변경하기 위해 GoToState를 호출하면 VisualStateManager는 다음을 수행합니다.

  • 먼저 컨트롤이 VisualState 전환 중 Storyboard이면 스토리보드가 시작됩니다. 그 후 컨트롤이 VisualState에서 전환되고 여기에 Storyboard가 있으면 스토리보드가 종료됩니다.

  • 컨트롤이 이미 stateName 상태 GoToState 이면 아무 작업도 수행하지 않고 반환합니다 true.

  • control위치에 없는 경우 stateName 아무 작업도 수행하지 않고 반환합니다false.ControlTemplate GoToState

상태 간 전환을 위한 다양한 논리를 제공하도록 사용자 고유 VisualStateManager 의 논리를 구현할 수 있습니다. 예를 들어 앞에서 설명한 논리를 변경하거나 사용자 지정 애니메이션 형식 간에 전환하는 논리를 제공할 수 있습니다. 구현 VisualStateManager하려면 메서드에서 VisualStateManager 상속하고 재정의하는 클래스를 GoToStateCore 만듭니다. 사용자 지정 클래스를 사용하려면 속성을 사용자 지정 형식의 개체로 설정합니다 CustomVisualStateManager .

적용 대상