41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
|
|
|
|
|
|
namespace WPFluent.Controls;
|
|
|
|
/// <summary>
|
|
/// Use <see cref="ToggleSwitch"/> to present users with two mutally exclusive options (like on/off).
|
|
/// </summary>
|
|
public class ToggleSwitch : System.Windows.Controls.Primitives.ToggleButton
|
|
{
|
|
/// <summary>
|
|
/// Identifies the <see cref="OffContent"/> dependency property.
|
|
/// </summary>
|
|
public static readonly DependencyProperty OffContentProperty = DependencyProperty.Register(
|
|
nameof(OffContent),
|
|
typeof(object),
|
|
typeof(ToggleSwitch),
|
|
new PropertyMetadata(null));
|
|
|
|
/// <summary>
|
|
/// Identifies the <see cref="OnContent"/> dependency property.
|
|
/// </summary>
|
|
public static readonly DependencyProperty OnContentProperty = DependencyProperty.Register(
|
|
nameof(OnContent),
|
|
typeof(object),
|
|
typeof(ToggleSwitch),
|
|
new PropertyMetadata(null));
|
|
|
|
/// <summary>
|
|
/// Gets or sets the content that should be displayed when the <see cref="ToggleSwitch"/> is in the "Off" state.
|
|
/// </summary>
|
|
[Bindable(true)]
|
|
public object OffContent { get => GetValue(OffContentProperty); set => SetValue(OffContentProperty, value); }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the content that should be displayed when the <see cref="ToggleSwitch"/> is in the "On" state.
|
|
/// </summary>
|
|
[Bindable(true)]
|
|
public object OnContent { get => GetValue(OnContentProperty); set => SetValue(OnContentProperty, value); }
|
|
}
|