VisualState 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
특정 상태에 있는 컨트롤의 시각적 모양을 나타냅니다.
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
- 상속
- 특성
예제
다음 예제에서는 VisualStateGroup 에 ControlTemplate 의 Button 호출 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, 있지만 대개는에서 사용 되는 ControlTemplate 의 Control합니다. 만드는 방법에 대 한 자세한를 ControlTemplate 하 고 VisualState 기존 컨트롤에 대 한 개체 참조 ControlTemplate을 만들어 기존 컨트롤의 모양 사용자 지정합니다. 사용 하는 예제에 대 한 VisualState 외부의 개체를 ControlTemplate를 참조 합니다 VisualStateManager 클래스입니다.
생성자
VisualState() |
VisualState 클래스의 새 인스턴스를 초기화합니다. |
속성
DependencyObjectType |
이 인스턴스의 DependencyObjectType CLR 형식을 래핑하는 값을 가져옵니다. (다음에서 상속됨 DependencyObject) |
Dispatcher |
이 Dispatcher와 연결된 DispatcherObject를 가져옵니다. (다음에서 상속됨 DispatcherObject) |
IsSealed |
이 인스턴스가 현재 봉인되어 있는지(읽기 전용인지) 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 DependencyObject) |
Name |
VisualState의 이름을 가져오거나 설정합니다. |
Storyboard |
컨트롤이 Storyboard가 나타내는 상태일 때 컨트롤의 모양을 정의하는 VisualState를 가져오거나 설정합니다. |