IToggleProvider.ToggleState 속성

정의

컨트롤의 설정/해제 상태를 가져옵니다.

public:
 property System::Windows::Automation::ToggleState ToggleState { System::Windows::Automation::ToggleState get(); };
public System.Windows.Automation.ToggleState ToggleState { get; }
member this.ToggleState : System.Windows.Automation.ToggleState
Public ReadOnly Property ToggleState As ToggleState

속성 값

ToggleState

컨트롤의 ToggleState입니다.

예제

다음 예제에서는 토글할 수 있는 컨트롤에 대 한이 메서드의 구현을 보여 있습니다. 반환된 ToggleState는 컨트롤의 색을 기반으로 합니다. 이는 CheckBox 컨트롤의 IsChecked 속성과 유사합니다.

/// <summary>
/// Retrieves the toggle state of the control.
/// </summary>
/// <remarks>
/// For this custom control the toggle state is reflected by the color 
/// of the control. This is analogous to the CheckBox IsChecked property.
/// Green   - ToggleState.On
/// Red     - ToggleState.Off
/// Yellow  - ToggleState.Indeterminate
/// </remarks>
ToggleState IToggleProvider.ToggleState
{
    get
    {
        return customControl.toggleStateColor[customControl.controlColor]; ;
    }
}
''' <summary>
''' Retrieves the toggle state of the control.
''' </summary>
''' <remarks>
''' For this custom control the toggle state is reflected by the color 
''' of the control. This is analogous to the CheckBox IsChecked property.
''' Green   - ToggleState.On
''' Red     - ToggleState.Off
''' Yellow  - ToggleState.Indeterminate
''' </remarks>
Private ReadOnly Property IToggleProvider_ToggleState() As ToggleState Implements IToggleProvider.ToggleState
    Get
        Return customControl.toggleStateColor(customControl.controlColor)

    End Get
End Property

설명

컨트롤은 다음 순서OnOffIndeterminate로 순환 ToggleState 해야 합니다.

적용 대상

추가 정보