Пример #1
0
    public LabelEntryDialogViewModel(Wallet wallet, TransactionInfo info)
    {
        _wallet          = wallet;
        SuggestionLabels = new SuggestionLabelsViewModel(wallet.KeyManager, Intent.Send, 3)
        {
            Labels = { info.UserLabels.Labels }
        };

        SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);

        var nextCommandCanExecute =
            Observable
            .Merge(SuggestionLabels.WhenAnyValue(x => x.Labels.Count).Select(_ => Unit.Default))
            .Merge(SuggestionLabels.WhenAnyValue(x => x.IsCurrentTextValid).Select(_ => Unit.Default))
            .Select(_ => SuggestionLabels.Labels.Any() || SuggestionLabels.IsCurrentTextValid);

        NextCommand = ReactiveCommand.Create(OnNext, nextCommandCanExecute);
    }
Пример #2
0
    public ReceiveViewModel(Wallet wallet)
    {
        _wallet = wallet;
        SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);

        EnableBack = false;

        SuggestionLabels = new SuggestionLabelsViewModel(wallet.KeyManager, Intent.Receive, 3);

        var nextCommandCanExecute =
            SuggestionLabels
            .WhenAnyValue(x => x.Labels.Count).Select(_ => Unit.Default)
            .Merge(SuggestionLabels.WhenAnyValue(x => x.IsCurrentTextValid).Select(_ => Unit.Default))
            .Select(_ => SuggestionLabels.Labels.Count > 0 || SuggestionLabels.IsCurrentTextValid);

        NextCommand = ReactiveCommand.Create(OnNext, nextCommandCanExecute);

        ShowExistingAddressesCommand = ReactiveCommand.Create(OnShowExistingAddresses);
    }
Пример #3
0
        public ReceiveViewModel(Wallet wallet)
        {
            _wallet = wallet;
            SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);

            EnableBack = false;

            SuggestionLabels = new SuggestionLabelsViewModel(3);

            NextCommand = ReactiveCommand.Create(OnNext, SuggestionLabels.WhenAnyValue(x => x.Labels.Count).Select(c => c > 0));

            ShowExistingAddressesCommand = ReactiveCommand.Create(OnShowExistingAddresses);
        }