[]
        
(Showing Draft Content)

C1.WPF.Input.C1ToggleSwitch

C1ToggleSwitch Class

Represents a switch that can be toggled between two states.

Inheritance
C1ToggleSwitch
Namespace: C1.WPF.Input
Assembly: C1.WPF.Input.dll
Syntax
[TemplatePart(Name = "ToggleContainer", Type = typeof(FrameworkElement))]
[TemplateVisualState(Name = "Normal", GroupName = "CommonStates")]
[TemplateVisualState(Name = "MouseOver", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Focused", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Disabled", GroupName = "CommonStates")]
[TemplateVisualState(Name = "On", GroupName = "ToggleStates")]
[TemplateVisualState(Name = "Off", GroupName = "ToggleStates")]
public class C1ToggleSwitch : C1View

Constructors

Name Description
C1ToggleSwitch()

Initializes a new instance of the C1ToggleSwitch class.

Fields

Name Description
AccentBrushProperty

Identifies the AccentBrush dependency property.

AccentForegroundProperty

Identifies the AccentForeground dependency property.

IsOnProperty

Identifies the IsOn dependency property.

OffContentProperty

Identifies the OffContent dependency property.

OnContentProperty

Identifies the OnContent dependency property.

Properties

Name Description
AccentBrush

Accent brush of the ToggleSwitch control.

AccentForeground

Accent foreground brush of the ToggleSwitch control.

IsFocused

Gets whether the control is focused.

IsOn

Gets or sets a value that declares whether the state of the ToggleSwitch is "On".

OffContent

Gets or sets the content displayed when the state is Off.

OnContent

Gets or sets the content displayed when the state is On.

Methods

Name Description
ChangeVisualStateCommon(bool)

Updates the current visual state of the Common visual state group to match the object's properties.

ChangeVisualStateToggle(bool)

Updates the current visual state of the Toggle visual state group to match the object's properties.

Dispose(bool)
OnApplyTemplate()
Toggle()

Inverts the state of the ToggleSwitch control.

Events

Name Description
IsOnChanged

Event raised when the IsOn property has changed.

Toggled

Fires when the control's state is changed.