Demka/Demka-2/ViewModels/MainViewModel.cs

30 lines
621 B
C#

using ReactiveUI;
using System.Windows.Input;
namespace Demka_2.ViewModels;
public class MainViewModel : ReactiveObject
{
private string _password;
private bool _isAdminMode;
public string Password
{
get => _password;
set => this.RaiseAndSetIfChanged(ref _password, value);
}
public bool IsAdminMode
{
get => _isAdminMode;
set => this.RaiseAndSetIfChanged(ref _isAdminMode, value);
}
public ICommand LoginCommand => ReactiveCommand.Create(() =>
{
if (_password == "0000")
{
IsAdminMode = true;
}
});
}