Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public LoginViewModel()
- {
- Ok = ReactiveCommand.Create(ReturnUser, isEnabled);
- Cancel = ReactiveCommand.Create(ExitProgram, isEnabled);
- ReturnCreateNewUser = ReactiveCommand.Create(CreateNewUser, isEnabled);
- ForgotPassword = ReactiveCommand.Create(ReturnForgotPassword, isEnabled);
- }
- internal static void ExitProgram() => Environment.Exit(0);
- internal static void ReturnForgotPassword()
- {
- MainWindowViewModel mainWindow = new();
- mainWindow.ShowForgotPassword();
- }
- internal static void CreateNewUser()
- {
- MainWindowViewModel mainWindow = new();
- mainWindow.CreateNewUser();
- }
- public UserModel ReturnUser()
- {
- NewUser.Username = Username;
- NewUser.Password = Password;
- bool canReturn = RunChecks();
- if (canReturn)
- {
- return NewUser;
- }
- return new UserModel();
- }
- public ReactiveCommand<Unit, UserModel> Ok { get; }
- public ReactiveCommand<Unit, Unit> Cancel { get; }
- public ReactiveCommand<Unit, Unit> ReturnCreateNewUser { get; }
- public ReactiveCommand<Unit, Unit> ForgotPassword { get; }
Advertisement
Add Comment
Please, Sign In to add comment