do not flash when there is a valid address
MODIFY
WalletWasabi.Fluent/Behaviors/PasteButtonFlashBehavior.cs
WalletWasabi.Fluent/Behaviors/PasteButtonFlashBehavior.cs
@@ -19,12 +19,21 @@ namespace WalletWasabi.Fluent.Behaviors
public static readonly StyledProperty<string> FlashAnimationProperty =
AvaloniaProperty.Register<PasteButtonFlashBehavior, string>(nameof(FlashAnimation));
+ public static readonly StyledProperty<bool> IsDisabledProperty =
+ AvaloniaProperty.Register<PasteButtonFlashBehavior, bool>(nameof(IsDisabled));
+
public string FlashAnimation
{
get => GetValue(FlashAnimationProperty);
set => SetValue(FlashAnimationProperty, value);
}
+ public bool IsDisabled
+ {
+ get => GetValue(IsDisabledProperty);
+ set => SetValue(IsDisabledProperty, value);
+ }
+
protected override void OnAttached(CompositeDisposable disposables)
{
if (AssociatedObject is null)
@@ -55,7 +64,7 @@ namespace WalletWasabi.Fluent.Behaviors
private async Task CheckClipboardForValidAddressAsync()
{
- if (Services.UiConfig.AutoPaste)
+ if (IsDisabled || Services.UiConfig.AutoPaste)
{
return;
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -49,6 +49,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
[AutoNotify] private bool _isFixedAmount;
[AutoNotify] private bool _isPayJoin;
[AutoNotify] private string? _payJoinEndPoint;
+ [AutoNotify] private bool _isValidAddress;
private bool _parsingUrl;
public SendViewModel(Wallet wallet)
@@ -283,6 +284,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
PayJoinEndPoint = null;
}
+ IsValidAddress = result;
return result;
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
NormalIcon="{StaticResource paste_regular}"
ClickIcon="{StaticResource copy_confirmed}">
<i:Interaction.Behaviors>
- <behaviors:PasteButtonFlashBehavior FlashAnimation="flash" />
+ <behaviors:PasteButtonFlashBehavior FlashAnimation="flash" IsDisabled="{Binding IsValidAddress}"/>
</i:Interaction.Behaviors>
</c:AnimatedButton>
<c:AnimatedButton IsVisible="{Binding IsQrButtonVisible}"

do not flash when there is a valid address