다음을 통해 공유


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

개체를 사용하여 상태 간을 전환하려면 A를 사용하고, 그렇지 않으면 .

반환

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

설명

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

  • 먼저 컨트롤이 VisualState 전환 중 Storyboard이면 스토리보드가 시작됩니다. 그런 다음 컨트롤에서 VisualState 오는 컨트롤에 스토리 Storyboard보드가 있으면 종료됩니다.

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

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

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

적용 대상