public AddedWalletPageViewModel(KeyManager keyManager) { WalletName = keyManager.WalletName; WalletType = WalletHelpers.GetType(keyManager); SetupCancel(enableCancel: false, enableCancelOnEscape: false, enableCancelOnPressed: false); EnableBack = false; NextCommand = ReactiveCommand.Create(() => OnNext(keyManager)); }
public HardwareWalletAuthDialogViewModel(Wallet wallet, TransactionAuthorizationInfo transactionAuthorizationInfo) { if (!wallet.KeyManager.IsHardwareWallet) { throw new InvalidOperationException("Not a hardware wallet."); } _wallet = wallet; _transactionAuthorizationInfo = transactionAuthorizationInfo; WalletType = WalletHelpers.GetType(wallet.KeyManager); SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true); EnableBack = false; }
public HardwareWalletAuthDialogViewModel(Wallet wallet, TransactionAuthorizationInfo transactionAuthorizationInfo) { if (!wallet.KeyManager.IsHardwareWallet) { throw new InvalidOperationException("Not a hardware wallet."); } _wallet = wallet; _transactionAuthorizationInfo = transactionAuthorizationInfo; WalletType = WalletHelpers.GetType(wallet.KeyManager); SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true); EnableBack = false; AuthorizationFailedMessage = $"Authorization failed.{Environment.NewLine}Please, check your device and try again."; }
public LoginViewModel(ClosedWalletViewModel closedWalletViewModel) { var wallet = closedWalletViewModel.Wallet; IsPasswordNeeded = !wallet.KeyManager.IsWatchOnly; WalletName = wallet.WalletName; _password = ""; _errorMessage = ""; WalletType = WalletHelpers.GetType(closedWalletViewModel.Wallet.KeyManager); NextCommand = ReactiveCommand.CreateFromTask(async() => await OnNextAsync(closedWalletViewModel, wallet)); OkCommand = ReactiveCommand.Create(OnOk); ForgotPasswordCommand = ReactiveCommand.Create(() => OnForgotPassword(wallet)); EnableAutoBusyOn(NextCommand); }