changes due to updated reactiveui
MODIFY
WalletWasabi.Gui/Controls/ExtendedTextBox.cs
WalletWasabi.Gui/Controls/ExtendedTextBox.cs
@@ -9,6 +9,7 @@ using System;
using System.Reactive.Linq;
using Avalonia.Media;
using System.Threading.Tasks;
+using System.Reactive;
namespace WalletWasabi.Gui.Controls
{
@@ -18,12 +19,12 @@ namespace WalletWasabi.Gui.Controls
public ExtendedTextBox()
{
- CopyCommand = ReactiveCommand.Create(async () =>
+ CopyCommand = ReactiveCommand.CreateFromTask(async () =>
{
await CopyAsync();
});
- PasteCommand = ReactiveCommand.Create(async () =>
+ PasteCommand = ReactiveCommand.CreateFromTask(async () =>
{
await PasteAsync();
});
@@ -54,8 +55,8 @@ namespace WalletWasabi.Gui.Controls
Type IStyleable.StyleKey => typeof(TextBox);
- private ReactiveCommand CopyCommand { get; }
- private ReactiveCommand PasteCommand { get; }
+ private ReactiveCommand<Unit, Unit> CopyCommand { get; }
+ private ReactiveCommand<Unit, Unit> PasteCommand { get; }
private async Task PasteAsync()
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -4,6 +4,7 @@ using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Text;
@@ -52,9 +53,9 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
AmountQueued = Money.Zero; // Global.ChaumianClient.State.SumAllQueuedCoinAmounts();
- EnqueueCommand = ReactiveCommand.Create(async () => await DoEnqueueAsync(CoinsList.Coins.Where(c => c.IsSelected)));
+ EnqueueCommand = ReactiveCommand.CreateFromTask(async () => await DoEnqueueAsync(CoinsList.Coins.Where(c => c.IsSelected)));
- DequeueCommand = ReactiveCommand.Create(async () => await DoDequeueAsync(CoinsList.Coins.Where(c => c.IsSelected)));
+ DequeueCommand = ReactiveCommand.CreateFromTask(async () => await DoDequeueAsync(CoinsList.Coins.Where(c => c.IsSelected)));
PrivacySomeCommand = ReactiveCommand.Create(() => TargetPrivacy = TargetPrivacy.Some);
@@ -62,7 +63,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
PrivacyStrongCommand = ReactiveCommand.Create(() => TargetPrivacy = TargetPrivacy.Strong);
- TargetButtonCommand = ReactiveCommand.Create(async () =>
+ TargetButtonCommand = ReactiveCommand.CreateFromTask(async () =>
{
switch (TargetPrivacy)
{
@@ -459,13 +460,13 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _targetPrivacy, value);
}
- public ReactiveCommand EnqueueCommand { get; }
+ public ReactiveCommand<Unit, Unit> EnqueueCommand { get; }
- public ReactiveCommand DequeueCommand { get; }
+ public ReactiveCommand<Unit, Unit> DequeueCommand { get; }
- public ReactiveCommand PrivacySomeCommand { get; }
- public ReactiveCommand PrivacyFineCommand { get; }
- public ReactiveCommand PrivacyStrongCommand { get; }
- public ReactiveCommand TargetButtonCommand { get; }
+ public ReactiveCommand<Unit, TargetPrivacy> PrivacySomeCommand { get; }
+ public ReactiveCommand<Unit, TargetPrivacy> PrivacyFineCommand { get; }
+ public ReactiveCommand<Unit, TargetPrivacy> PrivacyStrongCommand { get; }
+ public ReactiveCommand<Unit, Unit> TargetButtonCommand { get; }
}
}

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -8,6 +8,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using WalletWasabi.Gui.Models;
@@ -35,12 +36,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private GridLength _coinJoinStatusWidth;
private SortOrder _clustersSortDirection;
- public ReactiveCommand EnqueueCoin { get; }
- public ReactiveCommand DequeueCoin { get; }
- public ReactiveCommand SelectAllCheckBoxCommand { get; }
- public ReactiveCommand SelectPrivateCheckBoxCommand { get; }
- public ReactiveCommand SelectNonPrivateCheckBoxCommand { get; }
- public ReactiveCommand SortCommand { get; }
+ public ReactiveCommand<Unit, Unit> EnqueueCoin { get; }
+ public ReactiveCommand<Unit, Unit> DequeueCoin { get; }
+ public ReactiveCommand<Unit, Unit> SelectAllCheckBoxCommand { get; }
+ public ReactiveCommand<Unit, Unit> SelectPrivateCheckBoxCommand { get; }
+ public ReactiveCommand<Unit, Unit> SelectNonPrivateCheckBoxCommand { get; }
+ public ReactiveCommand<Unit, Unit> SortCommand { get; }
public event EventHandler DequeueCoinsPressed;

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -9,6 +9,7 @@ using System.Reactive.Linq;
using System.Threading.Tasks;
using WalletWasabi.Models;
using WalletWasabi.Logging;
+using System.Reactive;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
@@ -22,7 +23,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private SortOrder _amountSortDirection;
private SortOrder _transactionSortDirection;
- public ReactiveCommand SortCommand { get; }
+ public ReactiveCommand<Unit, Unit> SortCommand { get; }
public HistoryTabViewModel(WalletViewModel walletViewModel)
: base("History", walletViewModel)

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
@@ -27,9 +28,9 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private int _caretIndex;
private ObservableCollection<SuggestionViewModel> _suggestions;
- public ReactiveCommand CopyAddress { get; }
- public ReactiveCommand CopyLabel { get; }
- public ReactiveCommand ShowQrCode { get; }
+ public ReactiveCommand<Unit, Unit> CopyAddress { get; }
+ public ReactiveCommand<Unit, Unit> CopyLabel { get; }
+ public ReactiveCommand<Unit, Unit> ShowQrCode { get; }
public ReceiveTabViewModel(WalletViewModel walletViewModel)
: base("Receive", walletViewModel)
@@ -96,7 +97,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
var isCoinListItemSelected = this.WhenAnyValue(x => x.SelectedAddress).Select(coin => coin != null);
- CopyAddress = ReactiveCommand.Create(async () =>
+ CopyAddress = ReactiveCommand.CreateFromTask(async () =>
{
if (SelectedAddress is null) return;
await SelectedAddress.TryCopyToClipboardAsync();
@@ -257,6 +258,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Suggestions.Clear();
}
- public ReactiveCommand GenerateCommand { get; }
+ public ReactiveCommand<Unit, Unit> GenerateCommand { get; }
}
}

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Text;
@@ -182,7 +183,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
FeeRateCommand = ReactiveCommand.Create(ChangeFeeRateDisplay);
- BuildTransactionCommand = ReactiveCommand.Create(async () =>
+ BuildTransactionCommand = ReactiveCommand.CreateFromTask(async () =>
{
IsBusy = true;
try
@@ -841,11 +842,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _amountToolTip, value);
}
- public ReactiveCommand BuildTransactionCommand { get; }
+ public ReactiveCommand<Unit, Unit> BuildTransactionCommand { get; }
- public ReactiveCommand MaxCommand { get; }
+ public ReactiveCommand<Unit, Unit> MaxCommand { get; }
- public ReactiveCommand FeeRateCommand { get; }
+ public ReactiveCommand<Unit, Unit> FeeRateCommand { get; }
public override void OnOpen()
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoViewModel.cs
@@ -3,6 +3,7 @@ using NBitcoin;
using ReactiveUI;
using System;
using System.Linq;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Threading;
using System.Threading.Tasks;
@@ -91,7 +92,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public string EncryptedExtendedMasterPrivateKey => KeyManager.EncryptedSecret.ToWif();
public string AccountKeyPath => $"m/{KeyManager.AccountKeyPath.ToString()}";
- public ReactiveCommand ShowSensitiveKeysCommand { get; }
+ public ReactiveCommand<Unit, Unit> ShowSensitiveKeysCommand { get; }
public string Password
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -4,6 +4,7 @@ using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using WalletWasabi.Gui.ViewModels;
@@ -93,7 +94,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _title, value);
}
- public ReactiveCommand LurkingWifeModeCommand { get; }
+ public ReactiveCommand<Unit, Unit> LurkingWifeModeCommand { get; }
public ObservableCollection<WalletActionViewModel> Actions
{

MODIFY
WalletWasabi.Gui/Dialogs/CannotCloseDialogViewModel.cs
WalletWasabi.Gui/Dialogs/CannotCloseDialogViewModel.cs
@@ -3,6 +3,7 @@ using AvalonStudio.Extensibility.Dialogs;
using ReactiveUI;
using System;
using System.Linq;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Threading;
using System.Threading.Tasks;
@@ -38,8 +39,8 @@ namespace WalletWasabi.Gui.Dialogs
set => this.RaiseAndSetIfChanged(ref _operationMessage, value);
}
- public new ReactiveCommand OKCommand { get; set; }
- public new ReactiveCommand CancelCommand { get; set; }
+ public new ReactiveCommand<Unit, Unit> OKCommand { get; set; }
+ public new ReactiveCommand<Unit, Unit> CancelCommand { get; set; }
//http://blog.stephencleary.com/2013/01/async-oop-2-constructors.html
public Task Initialization { get; private set; }

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Sockets;
+using System.Reactive;
using System.Reactive.Disposables;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Gui.ViewModels.Validation;
@@ -24,8 +25,8 @@ namespace WalletWasabi.Gui.Tabs
private string _useTorText;
private bool _isModified;
- public ReactiveCommand OpenConfigFileCommand { get; }
- public ReactiveCommand LurkingWifeModeCommand { get; }
+ public ReactiveCommand<Unit, Unit> OpenConfigFileCommand { get; }
+ public ReactiveCommand<Unit, Unit> LurkingWifeModeCommand { get; }
public SettingsViewModel() : base("Settings")
{

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletViewModel.cs
@@ -5,6 +5,7 @@ using ReactiveUI;
using System;
using System.IO;
using System.Linq;
+using System.Reactive;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.KeyManagement;
@@ -113,7 +114,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
set => this.RaiseAndSetIfChanged(ref _validationMessage, value);
}
- public ReactiveCommand GenerateCommand { get; }
+ public ReactiveCommand<Unit, Unit> GenerateCommand { get; }
public void OnTermsClicked()
{

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -5,6 +5,7 @@ using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
+using System.Reactive;
using System.Threading.Tasks;
using WalletWasabi.Gui.Controls.WalletExplorer;
using WalletWasabi.Gui.ViewModels;
@@ -65,7 +66,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
}
});
- LoadCommand = ReactiveCommand.Create(LoadWalletAsync, this.WhenAnyValue(x => x.CanLoadWallet));
+ LoadCommand = ReactiveCommand.CreateFromTask(LoadWalletAsync, this.WhenAnyValue(x => x.CanLoadWallet));
TestPasswordCommand = ReactiveCommand.Create(() => LoadKeyManager(requirePassword: true), this.WhenAnyValue(x => x.CanTestPassword));
OpenFolderCommand = ReactiveCommand.Create(OpenWalletsFolder);
SetLoadButtonText(IsBusy);
@@ -214,8 +215,8 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
}
}
- public ReactiveCommand LoadCommand { get; }
- public ReactiveCommand TestPasswordCommand { get; }
+ public ReactiveCommand<Unit, Unit> LoadCommand { get; }
+ public ReactiveCommand<Unit, KeyManager> TestPasswordCommand { get; }
public KeyManager LoadKeyManager(bool requirePassword)
{
@@ -319,7 +320,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
}
}
- public ReactiveCommand OpenFolderCommand { get; }
+ public ReactiveCommand<Unit, Unit> OpenFolderCommand { get; }
public void OpenWalletsFolder()
{

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
@@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
+using System.Reactive;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
using WalletWasabi.KeyManagement;
@@ -131,7 +132,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
set => this.RaiseAndSetIfChanged(ref _caretIndex, value);
}
- public ReactiveCommand RecoverCommand { get; }
+ public ReactiveCommand<Unit, Unit> RecoverCommand { get; }
public void OnTermsClicked()
{

MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -5,6 +5,7 @@ using NBitcoin.Protocol;
using ReactiveUI;
using System;
using System.IO;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Runtime.InteropServices;
@@ -154,7 +155,7 @@ namespace WalletWasabi.Gui.ViewModels
});
}
- public ReactiveCommand UpdateCommand { get; }
+ public ReactiveCommand<Unit, Unit> UpdateCommand { get; }
public UpdateStatus UpdateStatus
{

changes due to updated reactiveui