Files
ShrlAlgoToolkit/AntdWpfDemo/ViewModels/SwitchViewModel.cs
ShrlAlgo 4d35cadb56 更新
2025-07-11 09:20:23 +08:00

34 lines
610 B
C#

using Caliburn.Micro;
using System.ComponentModel.Composition;
namespace AntdWpfDemo.ViewModels
{
[Export(typeof(IScreen))]
internal class SwitchViewModel : Screen
{
private bool isEnabled;
public bool IsEnabled
{
get { return isEnabled; }
set
{
isEnabled = value;
NotifyOfPropertyChange();
}
}
public SwitchViewModel()
{
DisplayName = "Switch";
}
public void Toggle()
{
IsEnabled = !isEnabled;
}
}
}