更新
This commit is contained in:
33
AntdWpfDemo/ViewModels/SwitchViewModel.cs
Normal file
33
AntdWpfDemo/ViewModels/SwitchViewModel.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user