public GenerateWalletPasswordViewModel(NavigationStateViewModel navigationState, IScreen wizardScreen, string title, WalletViewModel wallet, WalletManagerViewModel walletManager) : base(new NavigationStateViewModel() { Screen = () => wizardScreen, Dialog = () => navigationState.Dialog(), NextView = () => navigationState.NextView(), CancelView = () => navigationState.CancelView(), }, "GenerateWalletPassword", title) { ShowCommand = ReactiveCommand.Create(() => wizardScreen.Router.Navigate.Execute(this)); #if !USE_DIALOG CancelCommand = ReactiveCommand.Create(() => navigationState.Screen().Router.Navigate.Execute(navigationState.CancelView())); #else CancelCommand = ReactiveCommand.Create(() => { navigationState.Dialog().Router.NavigationStack.Clear(); navigationState.Screen().Router.Navigate.Execute(navigationState.CancelView()); }); #endif NextCommand = ReactiveCommand.Create(() => { wallet.Password = _password; wizardScreen.Router.Navigate.Execute( new GenerateWalletRecoveryViewModel(navigationState, wizardScreen, "Create Wallet", wallet, walletManager)); }); }
public GenerateWalletConfirmViewModel(NavigationStateViewModel navigationState, IScreen wizardScreen, string title, WalletViewModel wallet, WalletManagerViewModel walletManager) : base(new NavigationStateViewModel() { Screen = () => wizardScreen, Dialog = () => navigationState.Dialog(), NextView = () => navigationState.NextView(), CancelView = () => navigationState.CancelView(), }, "GenerateWalletConfirm", title) { _recoveryWords = wallet.RecoveryWords; ShowCommand = ReactiveCommand.Create(() => wizardScreen.Router.Navigate.Execute(this)); CancelCommand = ReactiveCommand.Create(() => navigationState.Screen().Router.NavigateAndReset.Execute(navigationState.CancelView())); NextCommand = ReactiveCommand.Create(() => { walletManager.Wallets.Add(wallet); #if USE_DIALOG navigationState.Dialog().Router.NavigationStack.Clear(); #endif navigationState.Screen().Router.NavigateAndReset.Execute(navigationState.NextView()); }); }