Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
    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.";
    }
Ejemplo n.º 4
0
    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);
    }