use SubscribeAsync where needed
MODIFY
WalletWasabi.Fluent/Behaviors/NumberBoxBehavior.cs
WalletWasabi.Fluent/Behaviors/NumberBoxBehavior.cs
@@ -6,6 +6,7 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
+using WalletWasabi.Fluent.Extensions;
namespace WalletWasabi.Fluent.Behaviors;
@@ -31,7 +32,7 @@ public class NumberBoxBehavior : DisposingBehavior<TextBox>
Observable
.FromEventPattern<RoutedEventArgs>(AssociatedObject, nameof(AssociatedObject.PastingFromClipboard))
.Select(x => x.EventArgs)
- .Subscribe(async e =>
+ .SubscribeAsync(async e =>
{
e.Handled = true;

MODIFY
WalletWasabi.Fluent/Behaviors/PasteButtonFlashBehavior.cs
WalletWasabi.Fluent/Behaviors/PasteButtonFlashBehavior.cs
@@ -8,6 +8,7 @@ using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using ReactiveUI;
using WalletWasabi.Fluent.Controls;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Userfacing;
namespace WalletWasabi.Fluent.Behaviors;
@@ -47,13 +48,13 @@ public class PasteButtonFlashBehavior : AttachedToVisualTreeBehavior<AnimatedBut
.Merge(this.WhenAnyValue(x => x.CurrentAddress).Select(_ => Unit.Default))
.Throttle(TimeSpan.FromMilliseconds(100))
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(async _ => await CheckClipboardForValidAddressAsync(forceCheck: true))
+ .SubscribeAsync(async _ => await CheckClipboardForValidAddressAsync(forceCheck: true))
.DisposeWith(disposables);
Observable
.Interval(TimeSpan.FromMilliseconds(500))
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(async _ =>
+ .SubscribeAsync(async _ =>
{
if (!mainWindow.IsActive)
{

MODIFY
WalletWasabi.Fluent/Controls/PreviewItem.axaml.cs
WalletWasabi.Fluent/Controls/PreviewItem.axaml.cs
@@ -5,6 +5,7 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Media;
using ReactiveUI;
+using WalletWasabi.Fluent.Extensions;
namespace WalletWasabi.Fluent.Controls;
@@ -59,7 +60,7 @@ public class PreviewItem : ContentControl
x => x.IsPointerOver,
x => x.PrivacyModeEnabled,
(copyParameter, isPointerOver, privacyModeEnabled) => !string.IsNullOrEmpty(copyParameter?.ToString()) && isPointerOver && !privacyModeEnabled)
- .Subscribe(async value =>
+ .SubscribeAsync(async value =>
{
if (_copyButtonPressedStopwatch is { } sw)
{

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/ShowQrCameraDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/ShowQrCameraDialogViewModel.cs
@@ -6,6 +6,7 @@ using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.Models;
using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
@@ -50,7 +51,7 @@ public partial class ShowQrCameraDialogViewModel : DialogViewModelBase<string?>
Observable.FromEventPattern<Exception>(_qrReader, nameof(_qrReader.ErrorOccurred))
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(async args =>
+ .SubscribeAsync(async args =>
{
Close();
await ShowErrorAsync(

MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -8,6 +8,7 @@ using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
using WalletWasabi.Blockchain.TransactionProcessing;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.NavBar;
using WalletWasabi.Fluent.ViewModels.Wallets;
@@ -88,7 +89,7 @@ public partial class WalletManagerViewModel : ViewModelBase
Observable
.FromEventPattern<ProcessedResult>(Services.WalletManager, nameof(Services.WalletManager.WalletRelevantTransactionProcessed))
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(async arg =>
+ .SubscribeAsync(async arg =>
{
var (sender, e) = arg;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/HistoryItemViewModelBase.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/HistoryItemViewModelBase.cs
@@ -5,6 +5,7 @@ using System.Windows.Input;
using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Transactions;
+using WalletWasabi.Fluent.Extensions;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems;
@@ -23,7 +24,7 @@ public abstract partial class HistoryItemViewModelBase : ViewModelBase
this.WhenAnyValue(x => x.IsFlashing)
.Where(x => x)
- .Subscribe(async _ =>
+ .SubscribeAsync(async _ =>
{
await Task.Delay(1260);
IsFlashing = false;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
@@ -14,6 +14,7 @@ using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Transactions;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.TreeDataGrid;
using WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems;
@@ -197,7 +198,7 @@ public partial class HistoryViewModel : ActivatableViewModel
base.OnActivated(disposables);
_updateTrigger
- .Subscribe(async _ => await UpdateAsync())
+ .SubscribeAsync(async _ => await UpdateAsync())
.DisposeWith(disposables);
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/TransactionDetailsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/TransactionDetailsViewModel.cs
@@ -7,6 +7,7 @@ using Avalonia;
using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Transactions;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Models;
using WalletWasabi.Wallets;
@@ -76,7 +77,7 @@ public partial class TransactionDetailsViewModel : RoutableViewModel
base.OnNavigatedTo(isInHistory, disposables);
_updateTrigger
- .Subscribe(async _ => await UpdateCurrentTransactionAsync())
+ .SubscribeAsync(async _ => await UpdateCurrentTransactionAsync())
.DisposeWith(disposables);
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/LoadingViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/LoadingViewModel.cs
@@ -4,6 +4,7 @@ using System.Reactive.Linq;
using System.Threading.Tasks;
using ReactiveUI;
using WalletWasabi.Blockchain.Blocks;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Models;
using WalletWasabi.Wallets;
@@ -31,10 +32,10 @@ public partial class LoadingViewModel : ActivatableViewModel
Services.Synchronizer.WhenAnyValue(x => x.BackendStatus)
.Where(status => status == BackendStatus.Connected)
- .Subscribe(async _ => await LoadWalletAsync(isBackendAvailable: true).ConfigureAwait(false));
+ .SubscribeAsync(async _ => await LoadWalletAsync(isBackendAvailable: true).ConfigureAwait(false));
Observable.FromEventPattern<bool>(Services.Synchronizer, nameof(Services.Synchronizer.ResponseArrivedIsGenSocksServFail))
- .Subscribe(async _ =>
+ .SubscribeAsync(async _ =>
{
if (Services.Synchronizer.BackendStatus == BackendStatus.Connected)
{

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -13,6 +13,7 @@ using WalletWasabi.Blockchain.TransactionBuilding;
using WalletWasabi.Blockchain.TransactionOutputs;
using WalletWasabi.Blockchain.Transactions;
using WalletWasabi.Exceptions;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.Models;
using WalletWasabi.Fluent.ViewModels.Dialogs;
@@ -70,7 +71,7 @@ public partial class TransactionPreviewViewModel : RoutableViewModel
});
PrivacySuggestions.WhenAnyValue(x => x.SelectedSuggestion)
- .Subscribe(async x =>
+ .SubscribeAsync(async x =>
{
PrivacySuggestions.IsOpen = false;
PrivacySuggestions.SelectedSuggestion = null;

use SubscribeAsync where needed