Share via


VisualStateGroup.CurrentState 속성

정의

GoToState 메서드에 대한 성공적인 호출에서 가장 최근에 설정된 VisualState를 가져옵니다.

public:
 property VisualState ^ CurrentState { VisualState ^ get(); };
VisualState CurrentState();
public VisualState CurrentState { get; }
var visualState = visualStateGroup.currentState;
Public ReadOnly Property CurrentState As VisualState

속성 값

GoToState 메서드 또는 null에 대한 성공적인 호출에서 가장 최근에 설정된 VisualState입니다.

설명

특정 VisualStateGroup의 상태에 대해 GoToState가 호출된 적이 없는 경우 는 CurrentState 입니다null. 컨트롤과 시각적 상태를 올바르게 디자인하면 안 됩니다. 컨트롤에 대한 제어 논리는 특정 스토리보드 동작이 없는 명명된 상태인 경우에도 항상 지정된 VisualStateGroup에서 하나의 상태를 선택할 수 있어야 합니다.

컨트롤에 대한 시각적 상태의 VisualStateGroup 집합이 여러 개 있을 수 있으므로 이러한 VisualStateGroup 각 개체는 를 보고할 CurrentState수 있습니다. 예를 들어 기본 컨트롤 템플릿이 있는 단추를 클릭하면 "CommonStates"는 "Pressed" VisualStateGroup 를 보고 CurrentState 하고 "FocusStates" VisualStateGroup 는 "PointerFocused"의 를 CurrentState 보고합니다.

적용 대상

추가 정보