ToggleSwitch
- Assembly:
Fluence.Wpf - Namespace:
Fluence.Wpf.Controls
public class ToggleSwitch : ToggleButton
A toggle switch control with On/Off content.
Remarks: Inspired by WinUI's ToggleSwitch.
Base type: ToggleButton
Constructors
ToggleSwitch
public ToggleSwitch()
Creates a new ToggleSwitch instance.
Properties
HeaderContent
public object HeaderContent { get; set; }
Gets or sets the header content displayed above the switch.
OffContent
public object OffContent { get; set; }
Gets or sets the content displayed when the switch is off.
OffContentTemplate
public DataTemplate OffContentTemplate { get; set; }
Gets or sets the data template for the off-state content.
OnContent
public object OnContent { get; set; }
Gets or sets the content displayed when the switch is on.
OnContentTemplate
public DataTemplate OnContentTemplate { get; set; }
Gets or sets the data template for the on-state content.
Methods
OnApplyTemplate
public override void OnApplyTemplate()
Documentation inherited from the ToggleButton API.
OnChecked
protected override void OnChecked(RoutedEventArgs e)
Documentation inherited from the ToggleButton API.
OnCreateAutomationPeer
protected override AutomationPeer OnCreateAutomationPeer()
Documentation inherited from the ToggleButton API.
OnIndeterminate
protected override void OnIndeterminate(RoutedEventArgs e)
Documentation inherited from the ToggleButton API.
OnUnchecked
protected override void OnUnchecked(RoutedEventArgs e)
Documentation inherited from the ToggleButton API.
Dependency property identifiers
Use these identifiers with WPF property APIs. The matching CLR properties appear above when the control exposes them.
HeaderContentProperty
public static readonly DependencyProperty HeaderContentProperty
Identifies the HeaderContent dependency property.
OffContentProperty
public static readonly DependencyProperty OffContentProperty
Identifies the OffContent dependency property.
OffContentTemplateProperty
public static readonly DependencyProperty OffContentTemplateProperty
Identifies the OffContentTemplate dependency property.
OnContentProperty
public static readonly DependencyProperty OnContentProperty
Identifies the OnContent dependency property.
OnContentTemplateProperty
public static readonly DependencyProperty OnContentTemplateProperty
Identifies the OnContentTemplate dependency property.