示例#1
0
 private void GoToAccountsOrNewUser()
 {
     if (AccountsService.Any())
     {
         GoToAccountsCommand.Execute(null);
     }
     else
     {
         GoToNewUserCommand.Execute(null);
     }
 }
示例#2
0
 private void GoToAccountsOrNewUser()
 {
     if (_accountsService.Any())
     {
         GoToAccountsCommand.ExecuteIfCan();
     }
     else
     {
         GoToNewUserCommand.ExecuteIfCan();
     }
 }
示例#3
0
        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());
        }