优化更新代码,添加界面功能并整合
This commit is contained in:
40
WPFluent/Controls/Toggle/ToggleSwitch.cs
Normal file
40
WPFluent/Controls/Toggle/ToggleSwitch.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
|
||||
|
||||
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); }
|
||||
}
|
||||
Reference in New Issue
Block a user