VisualState 클래스

정의

특정 상태에 있는 컨트롤의 시각적 모양을 나타냅니다.

public ref class VisualState : System::Windows::DependencyObject
[System.Windows.Markup.ContentProperty("Storyboard")]
[System.Windows.Markup.RuntimeNameProperty("Name")]
public class VisualState : System.Windows.DependencyObject
[<System.Windows.Markup.ContentProperty("Storyboard")>]
[<System.Windows.Markup.RuntimeNameProperty("Name")>]
type VisualState = class
    inherit DependencyObject
Public Class VisualState
Inherits DependencyObject
상속
특성

예제

다음 예제에서는 VisualStateGroupControlTemplateButton 호출 CommonStates 추가 VisualState 개체의 상태에 대 한 Normal, Pressed, 및 MouseOver합니다. 이 예제에서는 Button 간결하게 생략하는 상태도 Disabled CommonStates VisualStateGroup정의합니다. 전체 예제를 보려면 ControlTemplate을 만들어 기존 컨트롤의 모양 사용자 지정합니다.

  <!--Define the states and transitions for the common states.
      The states in the VisualStateGroup are mutually exclusive to
      each other.-->
  <VisualStateGroup x:Name="CommonStates">

    <!--The Normal state is the state the button is in
        when it is not in another state from this VisualStateGroup.-->
    <VisualState x:Name="Normal" />

    <!--Change the SolidColorBrush, BorderBrush, to red when the
        mouse is over the button.-->
    <VisualState x:Name="MouseOver">
      <Storyboard>
        <ColorAnimation Storyboard.TargetName="BorderBrush" 
                        Storyboard.TargetProperty="Color" 
                        To="Red" />
      </Storyboard>
    </VisualState>

    <!--Change the SolidColorBrush, BorderBrush, to Transparent when the
        button is pressed.-->
    <VisualState x:Name="Pressed">
      <Storyboard>
        <ColorAnimation Storyboard.TargetName="BorderBrush" 
                        Storyboard.TargetProperty="Color"
                        To="Transparent"/>
      </Storyboard>
    </VisualState>

    <!--The Disabled state is omitted for brevity.-->
  </VisualStateGroup>
</VisualStateManager.VisualStateGroups>

설명

VisualState 특정 상태에 있을 때 컨트롤의 모양을 지정 합니다. 예를 들어 경우는 Button 은 눌렀을 때 해당 테두리 않을 평소 보다 다른 색입니다. 합니다 VisualState 클래스에는 Storyboard 컨트롤의 모양을 변경 하는 속성입니다. 컨트롤에 지정 된 상태로 전환 하는 경우는 VisualState.Name 속성을 Storyboard 시작 합니다. 컨트롤 상태를 종료 하는 경우는 Storyboard 중지 합니다.

합니다 VisualStateGroup.States 속성에 들어 VisualState 개체입니다. VisualStateGroup 개체에 추가 됩니다는 VisualStateManager.VisualStateGroups 연결 된 속성에 정의 된의에 FrameworkElement합니다. 추가할 수 있습니다 VisualState 개체를 하나 FrameworkElement, 있지만 대개는에서 사용 되는 ControlTemplateControl합니다. 만드는 방법에 대 한 자세한를 ControlTemplate 하 고 VisualState 기존 컨트롤에 대 한 개체 참조 ControlTemplate을 만들어 기존 컨트롤의 모양 사용자 지정합니다. 사용 하는 예제에 대 한 VisualState 외부의 개체를 ControlTemplate를 참조 합니다 VisualStateManager 클래스입니다.

생성자

VisualState()

VisualState 클래스의 새 인스턴스를 초기화합니다.

속성

DependencyObjectType

이 인스턴스의 DependencyObjectType CLR 형식을 래핑하는 값을 가져옵니다.

(다음에서 상속됨 DependencyObject)
Dispatcher

Dispatcher와 연결된 DispatcherObject를 가져옵니다.

(다음에서 상속됨 DispatcherObject)
IsSealed

이 인스턴스가 현재 봉인되어 있는지(읽기 전용인지) 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 DependencyObject)
Name

VisualState의 이름을 가져오거나 설정합니다.

Storyboard

컨트롤이 Storyboard가 나타내는 상태일 때 컨트롤의 모양을 정의하는 VisualState를 가져오거나 설정합니다.

메서드

CheckAccess()

호출 스레드가 이 DispatcherObject에 액세스할 수 있는지 여부를 확인합니다.

(다음에서 상속됨 DispatcherObject)
ClearValue(DependencyProperty)

속성의 로컬 값을 지웁니다. 지울 속성이 DependencyProperty 식별자에서 지정됩니다.

(다음에서 상속됨 DependencyObject)
ClearValue(DependencyPropertyKey)

읽기 전용 속성의 로컬 값을 지웁니다. 선언할 속성이 DependencyPropertyKey에서 지정됩니다.

(다음에서 상속됨 DependencyObject)
CoerceValue(DependencyProperty)

지정된 종속성 속성의 값을 강제 변환합니다. 호출하는 DependencyObject에 있으므로 이 작업은 종속성 속성의 속성 메타데이터에 지정된 CoerceValueCallback 함수를 호출하여 수행합니다.

(다음에서 상속됨 DependencyObject)
Equals(Object)

제공된 DependencyObject가 현재 DependencyObject에 해당하는지 여부를 확인합니다.

(다음에서 상속됨 DependencyObject)
GetHashCode()

DependencyObject의 해시 코드를 가져옵니다.

(다음에서 상속됨 DependencyObject)
GetLocalValueEnumerator()

DependencyObject에 대해 로컬로 값을 설정한 종속성 속성을 확인하기 위한 특수 열거자를 만듭니다.

(다음에서 상속됨 DependencyObject)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
GetValue(DependencyProperty)

DependencyObject의 인스턴스에서 종속성 속성의 현재 유효 값을 반환합니다.

(다음에서 상속됨 DependencyObject)
InvalidateProperty(DependencyProperty)

지정된 종속성 속성의 유효 값을 다시 계산합니다.

(다음에서 상속됨 DependencyObject)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
OnPropertyChanged(DependencyPropertyChangedEventArgs)

DependencyObject에서 종속성 속성의 유효 값이 업데이트될 때마다 호출됩니다. 변경된 특정 종속성 속성이 이벤트 데이터에서 보고됩니다.

(다음에서 상속됨 DependencyObject)
ReadLocalValue(DependencyProperty)

종속성 속성의 로컬 값을 반환합니다(있는 경우).

(다음에서 상속됨 DependencyObject)
SetCurrentValue(DependencyProperty, Object)

해당 값 소스를 변경하지 않고 종속성 속성의 값을 설정합니다.

(다음에서 상속됨 DependencyObject)
SetValue(DependencyProperty, Object)

지정된 종속성 속성 식별자를 가진 종속성 속성의 로컬 값을 설정합니다.

(다음에서 상속됨 DependencyObject)
SetValue(DependencyPropertyKey, Object)

종속성 속성의 DependencyPropertyKey 식별자에 의해 지정된 읽기 전용 종속성 속성의 로컬 값을 설정합니다.

(다음에서 상속됨 DependencyObject)
ShouldSerializeProperty(DependencyProperty)

serialization 프로세스에서 지정된 종속성 속성의 값을 직렬화해야 하는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 DependencyObject)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)
VerifyAccess()

호출 스레드에서 이 DispatcherObject에 액세스할 수 있는지 확인합니다.

(다음에서 상속됨 DispatcherObject)

적용 대상