public StartupViewModel(IAccountsService accountsService, IAccountValidatorService accountValidator) { AccountsService = accountsService; AccountValidator = accountValidator; GoToMainCommand = new ReactiveCommand(); GoToAccountsCommand = new ReactiveCommand(); GoToNewUserCommand = new ReactiveCommand(); BecomeActiveWindowCommand = new ReactiveCommand(); GoToAccountsCommand.Subscribe(_ => ShowViewModel(CreateViewModel <AccountsViewModel>())); GoToNewUserCommand.Subscribe(_ => ShowViewModel(CreateViewModel(typeof(IAddAccountViewModel)))); GoToMainCommand.Subscribe(_ => ShowViewModel(CreateViewModel(typeof(IMainViewModel)))); LoadCommand.RegisterAsyncTask(x => Load()); }
public StartupViewModel(IAccountsService accountsService, IAccountValidatorService accountValidator) { AccountsService = accountsService; AccountValidator = accountValidator; GoToMainCommand = ReactiveCommand.Create(); GoToAccountsCommand = ReactiveCommand.Create(); GoToNewUserCommand = ReactiveCommand.Create(); BecomeActiveWindowCommand = ReactiveCommand.Create(); GoToAccountsCommand.Subscribe(_ => ShowViewModel(CreateViewModel<AccountsViewModel>())); GoToNewUserCommand.Subscribe(_ => ShowViewModel(CreateViewModel<IAddAccountViewModel>())); GoToMainCommand.Subscribe(_ => ShowViewModel(CreateViewModel<IMainViewModel>())); LoadCommand = ReactiveCommand.CreateAsyncTask(x => Load()); }