add a loading suggestions indicator.
MODIFY
WalletWasabi.Fluent/Behaviors/ShowFlyoutOnPointerOverBehavior.cs
WalletWasabi.Fluent/Behaviors/ShowFlyoutOnPointerOverBehavior.cs
@@ -4,29 +4,49 @@ using System.Reactive.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
+using Avalonia.Threading;
using ReactiveUI;
namespace WalletWasabi.Fluent.Behaviors
{
- public class BindableFlyoutOpenBehavior : DisposingBehavior<Control>
+ public class BindableFlyoutOpenBehavior : ShowFlyoutOnPointerOverBehavior
{
public static readonly StyledProperty<bool> IsOpenProperty =
AvaloniaProperty.Register<BindableFlyoutOpenBehavior, bool>( nameof(IsOpen));
+ private IDisposable? _pointerEnterDisposable;
+
public bool IsOpen
{
get => GetValue(IsOpenProperty);
set => SetValue(IsOpenProperty, value);
}
+ private IDisposable SubscribePointerOver()
+ {
+ _pointerEnterDisposable?.Dispose();
+
+ return _pointerEnterDisposable = Observable
+ .FromEventPattern(AssociatedObject, nameof(AssociatedObject.PointerEnter))
+ .Subscribe(_ =>
+ {
+ _pointerEnterDisposable?.Dispose();
+ _pointerEnterDisposable = null;
+ FlyoutBase.ShowAttachedFlyout(AssociatedObject);
+ });
+ }
+
protected override void OnAttached(CompositeDisposable disposable)
{
Observable.FromEventPattern(AssociatedObject!, nameof(AssociatedObject.PointerPressed))
.Subscribe(x =>
{
- FlyoutBase.ShowAttachedFlyout(AssociatedObject!);
+ //FlyoutBase.ShowAttachedFlyout(AssociatedObject!);
}).DisposeWith(disposable);
+ SubscribePointerOver()
+ .DisposeWith(disposable);
+
this.WhenAnyValue(x => x.IsOpen)
.Subscribe(x =>
{
@@ -37,6 +57,12 @@ namespace WalletWasabi.Fluent.Behaviors
else if(Flyout.GetAttachedFlyout(AssociatedObject) is FlyoutBase flyout)
{
Flyout.GetAttachedFlyout(AssociatedObject!)?.Hide();
+
+ Dispatcher.UIThread.Post(() =>
+ {
+ SubscribePointerOver()
+ .DisposeWith(disposable);
+ });
}
});
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -281,6 +281,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
[AutoNotify] private bool _adjustFeeAvailable;
[AutoNotify] private bool _issuesTooltip;
[AutoNotify] private TransactionSummaryViewModel? _displayedTransactionSummary;
+ [AutoNotify] public bool _isLoading;
public TransactionPreviewViewModel(Wallet wallet, TransactionInfo info)
{
@@ -593,9 +594,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
UpdateTransaction(CurrentTransactionSummary, initialTransaction);
+ IsLoading = true;
var (selected, suggestions) =
await ChangeAvoidanceSuggestionViewModel.GenerateSuggestions(_info, _wallet, _transaction);
+ IsLoading = false;
+
PrivacySuggestions.Suggestions.Clear();
foreach (var suggestion in suggestions.Where(x=>!x.IsOriginal))

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
<Image Width="120" Source="avares://WalletWasabi.Fluent/Assets/TechnologyLogos/payjoin.png"
ToolTip.Tip="Your privacy is being protected with PayJoin."
IsVisible="{Binding CurrentTransactionSummary.IsPayJoin}" />
+
+ <c:ProgressRing Height="25" Width="25" IsIndeterminate="True" IsVisible="{Binding IsLoading}" />
+
<Viewbox Cursor="Hand" Height="20" IsVisible="{Binding CurrentTransactionSummary.MaxPrivacy}">
<Interaction.Behaviors>
<behaviors:ShowFlyoutOnPointerOverBehavior />
</FlyoutBase.AttachedFlyout>
<Panel.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
+ <Binding Path="IsLoading" Converter="{x:Static BoolConverters.Not}"/>
<Binding Path="CurrentTransactionSummary.TransactionHasChange" />
<Binding Path="CurrentTransactionSummary.IsPayJoin" Converter="{x:Static BoolConverters.Not}" />
</MultiBinding>

add a loading suggestions indicator.