private void GoToAccountsOrNewUser() { if (AccountsService.Any()) { GoToAccountsCommand.Execute(null); } else { GoToNewUserCommand.Execute(null); } }
private void GoToAccountsOrNewUser() { if (_accountsService.Any()) { GoToAccountsCommand.ExecuteIfCan(); } else { GoToNewUserCommand.ExecuteIfCan(); } }
public StartupViewModel(IAccountsService accountsService, ILoginService loginService) { _accountsService = accountsService; _loginService = loginService; GoToMainCommand = ReactiveCommand.Create(); GoToAccountsCommand = ReactiveCommand.Create(); GoToNewUserCommand = ReactiveCommand.Create(); BecomeActiveWindowCommand = ReactiveCommand.Create(); GoToAccountsCommand.Subscribe(_ => ShowViewModel(CreateViewModel <AccountsViewModel>())); GoToNewUserCommand.Subscribe(_ => ShowViewModel(CreateViewModel <NewAccountViewModel>())); GoToMainCommand.Subscribe(_ => ShowViewModel(CreateViewModel <MenuViewModel>())); LoadCommand = ReactiveCommand.CreateAsyncTask(x => Load()); }