コード例 #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));
        }
コード例 #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;
        }
コード例 #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.";
    }
コード例 #4
0
ファイル: LoginViewModel.cs プロジェクト: soosr/WalletWasabi
    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);
    }