replace `Select(_ => Unit.Default)` with `ToSignal()`
MODIFY
WalletWasabi.Fluent/Behaviors/CheckMarkVisibilityBehavior.cs
WalletWasabi.Fluent/Behaviors/CheckMarkVisibilityBehavior.cs
@@ -5,6 +5,7 @@ using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Avalonia.Xaml.Interactivity;
+using WalletWasabi.Fluent.Extensions;
namespace WalletWasabi.Fluent.Behaviors;
@@ -37,8 +38,8 @@ public class CheckMarkVisibilityBehavior : Behavior<PathIcon>
var hasErrors = OwnerTextBox.GetObservable(DataValidationErrors.HasErrorsProperty);
var text = OwnerTextBox.GetObservable(TextBox.TextProperty);
- hasErrors.Select(_ => Unit.Default)
- .Merge(text.Select(_ => Unit.Default))
+ hasErrors.ToSignal()
+ .Merge(text.ToSignal())
.Throttle(TimeSpan.FromMilliseconds(100))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(

MODIFY
WalletWasabi.Fluent/Behaviors/FocusNextWhenValidBehavior.cs
WalletWasabi.Fluent/Behaviors/FocusNextWhenValidBehavior.cs
@@ -5,6 +5,7 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using ReactiveUI;
+using WalletWasabi.Fluent.Extensions;
namespace WalletWasabi.Fluent.Behaviors;
@@ -20,8 +21,8 @@ public class FocusNextWhenValidBehavior : DisposingBehavior<TextBox>
var hasErrors = AssociatedObject.GetObservable(DataValidationErrors.HasErrorsProperty);
var text = AssociatedObject.GetObservable(TextBox.TextProperty);
- hasErrors.Select(_ => Unit.Default)
- .Merge(text.Select(_ => Unit.Default))
+ hasErrors.ToSignal()
+ .Merge(text.ToSignal())
.Throttle(TimeSpan.FromMilliseconds(100))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ =>

MODIFY
WalletWasabi.Fluent/Behaviors/PasteButtonFlashBehavior.cs
WalletWasabi.Fluent/Behaviors/PasteButtonFlashBehavior.cs
@@ -44,8 +44,8 @@ public class PasteButtonFlashBehavior : AttachedToVisualTreeBehavior<AnimatedBut
var mainWindow = lifetime.MainWindow;
Observable
- .FromEventPattern(mainWindow, nameof(mainWindow.Activated)).Select(_ => Unit.Default)
- .Merge(this.WhenAnyValue(x => x.CurrentAddress).Select(_ => Unit.Default))
+ .FromEventPattern(mainWindow, nameof(mainWindow.Activated)).ToSignal()
+ .Merge(this.WhenAnyValue(x => x.CurrentAddress).ToSignal())
.Throttle(TimeSpan.FromMilliseconds(100))
.ObserveOn(RxApp.MainThreadScheduler)
.SubscribeAsync(async _ => await CheckClipboardForValidAddressAsync(forceCheck: true))

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/LabelEntryDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/LabelEntryDialogViewModel.cs
@@ -5,6 +5,7 @@ using System.Reactive.Linq;
using DynamicData;
using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
using WalletWasabi.Fluent.ViewModels.Wallets.Labels;
using WalletWasabi.Fluent.ViewModels.Wallets.Send;
@@ -29,8 +30,8 @@ public partial class LabelEntryDialogViewModel : DialogViewModelBase<SmartLabel?
var nextCommandCanExecute =
Observable
- .Merge(SuggestionLabels.WhenAnyValue(x => x.Labels.Count).Select(_ => Unit.Default))
- .Merge(SuggestionLabels.WhenAnyValue(x => x.IsCurrentTextValid).Select(_ => Unit.Default))
+ .Merge(SuggestionLabels.WhenAnyValue(x => x.Labels.Count).ToSignal())
+ .Merge(SuggestionLabels.WhenAnyValue(x => x.IsCurrentTextValid).ToSignal())
.Select(_ => SuggestionLabels.Labels.Any() || SuggestionLabels.IsCurrentTextValid);
NextCommand = ReactiveCommand.Create(OnNext, nextCommandCanExecute);
@@ -48,7 +49,7 @@ public partial class LabelEntryDialogViewModel : DialogViewModelBase<SmartLabel?
base.OnNavigatedTo(isInHistory, disposables);
_wallet.TransactionProcessor.WhenAnyValue(x => x.Coins)
- .Select(_ => Unit.Default)
+ .ToSignal()
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ => SuggestionLabels.UpdateLabels())
.DisposeWith(disposables);

MODIFY
WalletWasabi.Fluent/ViewModels/SearchBar/Settings/Setting.cs
WalletWasabi.Fluent/ViewModels/SearchBar/Settings/Setting.cs
@@ -4,6 +4,7 @@ using System.Reactive;
using System.Reactive.Linq;
using System.Windows.Input;
using ReactiveUI;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.Settings;
@@ -39,7 +40,7 @@ public partial class Setting<TTarget, TProperty> : ReactiveObject
this.WhenAnyValue(x => x.Value)
.ObserveOn(RxApp.MainThreadScheduler)
.Skip(1)
- .Select(_ => Unit.Default)
+ .ToSignal()
.InvokeCommand(SetValueCommand);
this.WhenAnyValue(x => x.Value)
@@ -47,7 +48,7 @@ public partial class Setting<TTarget, TProperty> : ReactiveObject
.Throttle(TimeSpan.FromMilliseconds(SettingsTabViewModelBase.ThrottleTime + 50))
.ObserveOn(RxApp.MainThreadScheduler)
.Where(_ => SettingsTabViewModelBase.CheckIfRestartIsNeeded())
- .Select(_ => Unit.Default)
+ .ToSignal()
.InvokeCommand(ShowNotificationCommand);
}

MODIFY
WalletWasabi.Fluent/ViewModels/StatusIcon/StatusIconViewModel.cs
WalletWasabi.Fluent/ViewModels/StatusIcon/StatusIconViewModel.cs
@@ -9,6 +9,7 @@ using ReactiveUI;
using WalletWasabi.BitcoinCore.Monitoring;
using WalletWasabi.BitcoinP2p;
using WalletWasabi.Fluent.AppServices.Tor;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.Models;
using WalletWasabi.Helpers;
@@ -163,9 +164,9 @@ public partial class StatusIconViewModel : IStatusIconViewModel, IDisposable
Peers = TorStatus == TorStatus.NotRunning ? 0 : nodes.Count;
Observable
- .Merge(Observable.FromEventPattern(nodes, nameof(nodes.Added)).Select(_ => Unit.Default)
- .Merge(Observable.FromEventPattern<NodeEventArgs>(nodes, nameof(nodes.Removed)).Select(_ => Unit.Default)
- .Merge(Services.Synchronizer.WhenAnyValue(x => x.TorStatus).Select(_ => Unit.Default))))
+ .Merge(Observable.FromEventPattern(nodes, nameof(nodes.Added)).ToSignal()
+ .Merge(Observable.FromEventPattern<NodeEventArgs>(nodes, nameof(nodes.Removed)).ToSignal()
+ .Merge(Services.Synchronizer.WhenAnyValue(x => x.TorStatus).ToSignal())))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ => Peers = synchronizer.TorStatus == TorStatus.NotRunning ? 0 : nodes.Count) // Set peers to 0 if Tor is not running, because we get Tor status from backend answer so it seems to the user that peers are connected over clearnet, while they are not.
.DisposeWith(Disposables);

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Labels/SuggestionLabelsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Labels/SuggestionLabelsViewModel.cs
@@ -7,6 +7,7 @@ using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
using WalletWasabi.Blockchain.Keys;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.Helpers;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Labels;
@@ -127,8 +128,8 @@ public partial class SuggestionLabelsViewModel : ViewModelBase
private void CreateSuggestions(int topSuggestionsCount)
{
- var suggestionLabelsFilter = this.WhenAnyValue(x => x.Labels).Select(_ => Unit.Default)
- .Merge(Observable.FromEventPattern(Labels, nameof(Labels.CollectionChanged)).Select(_ => Unit.Default))
+ var suggestionLabelsFilter = this.WhenAnyValue(x => x.Labels).ToSignal()
+ .Merge(Observable.FromEventPattern(Labels, nameof(Labels.CollectionChanged)).ToSignal())
.Select(_ => SuggestionLabelsFilter());
_sourceLabels

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveViewModel.cs
@@ -6,6 +6,7 @@ using System.Windows.Input;
using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Keys;
+using WalletWasabi.Fluent.Extensions;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Fluent.ViewModels.Wallets.Labels;
using WalletWasabi.Wallets;
@@ -37,8 +38,8 @@ public partial class ReceiveViewModel : RoutableViewModel
var nextCommandCanExecute =
SuggestionLabels
- .WhenAnyValue(x => x.Labels.Count).Select(_ => Unit.Default)
- .Merge(SuggestionLabels.WhenAnyValue(x => x.IsCurrentTextValid).Select(_ => Unit.Default))
+ .WhenAnyValue(x => x.Labels.Count).ToSignal()
+ .Merge(SuggestionLabels.WhenAnyValue(x => x.IsCurrentTextValid).ToSignal())
.Select(_ => SuggestionLabels.Labels.Count > 0 || SuggestionLabels.IsCurrentTextValid);
NextCommand = ReactiveCommand.Create(OnNext, nextCommandCanExecute);

replace `Select(_ => Unit.Default)` with `ToSignal()`