somewhat working privacy suggestions workflow.
MODIFY
WalletWasabi.Fluent/Behaviors/ShowFlyoutOnPointerOverBehavior.cs
WalletWasabi.Fluent/Behaviors/ShowFlyoutOnPointerOverBehavior.cs
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;
+using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
+using ReactiveUI;
namespace WalletWasabi.Fluent.Behaviors
{
+ public class BindableFlyoutOpenBehavior : DisposingBehavior<Control>
+ {
+ public static readonly StyledProperty<bool> IsOpenProperty =
+ AvaloniaProperty.Register<BindableFlyoutOpenBehavior, bool>( nameof(IsOpen));
+
+ public bool IsOpen
+ {
+ get => GetValue(IsOpenProperty);
+ set => SetValue(IsOpenProperty, value);
+ }
+
+ protected override void OnAttached(CompositeDisposable disposable)
+ {
+ Observable.FromEventPattern(AssociatedObject!, nameof(AssociatedObject.PointerPressed))
+ .Subscribe(x =>
+ {
+ FlyoutBase.ShowAttachedFlyout(AssociatedObject!);
+ }).DisposeWith(disposable);
+
+ this.WhenAnyValue(x => x.IsOpen)
+ .Subscribe(x =>
+ {
+ if(x)
+ {
+ FlyoutBase.ShowAttachedFlyout(AssociatedObject!);
+ }
+ else if(Flyout.GetAttachedFlyout(AssociatedObject) is FlyoutBase flyout)
+ {
+ Flyout.GetAttachedFlyout(AssociatedObject!)?.Hide();
+ }
+ });
+ }
+
+
+ }
public class ShowFlyoutOnPointerOverBehavior : DisposingBehavior<Control>
{
protected override void OnAttached(CompositeDisposable disposables)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -292,10 +292,21 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
}
});
+ PrivacySuggestions.WhenAnyValue(x => x.SelectedSuggestion)
+ .Subscribe(x =>
+ {
+ PrivacySuggestions.IsOpen = false;
+
+ if (x is { })
+ {
+ UpdateTransaction(CurrentTransactionSummary, x.TransactionResult);
+ }
+ });
+
PrivacySuggestions.WhenAnyValue(x => x.IsOpen)
.Subscribe(x =>
{
- if (!x && PrivacySuggestions.SelectedSuggestion is { })
+ if (!x)
{
DisplayedTransactionSummary = CurrentTransactionSummary;
}
@@ -587,7 +598,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
}
PrivacySuggestions.PreviewSuggestion = selected;
- PrivacySuggestions.SelectedSuggestion = selected;
}
}
else

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
</Viewbox>
<Panel Cursor="Hand" Margin="10">
<Interaction.Behaviors>
- <behaviors:ShowFlyoutOnPointerOverBehavior />
+ <behaviors:BindableFlyoutOpenBehavior IsOpen="{Binding PrivacySuggestions.IsOpen}" />
</Interaction.Behaviors>
<FlyoutBase.AttachedFlyout>
<Flyout Placement="Bottom" ShowMode="TransientWithDismissOnPointerMoveAway" IsOpen="{Binding PrivacySuggestions.IsOpen, Mode=OneWayToSource}">

somewhat working privacy suggestions workflow.