Add option to send whole balance
MODIFY
WalletWasabi.Fluent/Styles/Button.axaml
WalletWasabi.Fluent/Styles/Button.axaml
<Button Classes="plain" Content="Plain Button" />
<Button Classes="function" Content="Function Button" />
<Button Classes="invisible" Content="Invisible Button" />
+ <Button Classes="plainHyperlink" Content="Quick" />
</StackPanel>
</Border>
</Design.PreviewWith>
<Setter Property="Background" Value="{DynamicResource ActionButtonDisabledBackgroundColor}" />
</Style>
-
<Style Selector="Button.plain">
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Background" Value="{DynamicResource InvisibleButtonPressedBackgroundColor}" />
</Style>
+ <Style Selector="Button.plainHyperlink">
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="Padding" Value="0" />
+ <Setter Property="BorderThickness" Value="0" />
+ <Setter Property="Cursor" Value="Hand" />
+ </Style>
+ <Style Selector="Button.plainHyperlink:pointerover /template/ ContentPresenter#PART_ContentPresenter">
+ <Setter Property="Background" Value="Transparent" />
+ </Style>
+ <Style Selector="Button.plainHyperlink:disabled /template/ ContentPresenter#PART_ContentPresenter">
+ <Setter Property="Background" Value="Transparent" />
+ </Style>
+ <Style Selector="Button.plainHyperlink:pointerover TextBlock">
+ <Setter Property="TextDecorations" Value="Underline" />
+ </Style>
+ <Style Selector="Button.plainHyperlink:pointerover AccessText">
+ <Setter Property="TextDecorations" Value="Underline" />
+ </Style>
</Styles>

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -26,6 +26,10 @@ using WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles;
using System.Reactive;
using System.Collections.ObjectModel;
using WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems;
+using Avalonia.Animation.Animators;
+using WalletWasabi.Exceptions;
+using DynamicData;
+using System.Linq;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Send;
@@ -93,6 +97,15 @@ public partial class SendViewModel : RoutableViewModel
PasteCommand = ReactiveCommand.CreateFromTask(async () => await OnPasteAsync());
AutoPasteCommand = ReactiveCommand.CreateFromTask(async () => await OnAutoPasteAsync());
+ InsertMaxCommand = ReactiveCommand.Create(() =>
+ {
+ if (Balance.BalanceBtc is not null)
+ {
+ string[] balanceStringParts = Balance.BalanceBtc.Split(" ");
+ string wholeBalance = string.Join("", balanceStringParts.SkipLast(1));
+ AmountBtc = decimal.Parse(wholeBalance);
+ }
+ });
QrCommand = ReactiveCommand.Create(async () =>
{
ShowQrCameraDialogViewModel dialog = new(_wallet.Network);
@@ -146,6 +159,8 @@ public partial class SendViewModel : RoutableViewModel
public ICommand QrCommand { get; }
+ public ICommand InsertMaxCommand { get; }
+
public WalletBalanceTileViewModel Balance { get; }
private async Task OnAutoPasteAsync()

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
<TextBlock Text="Send" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="10" VerticalAlignment="Center">
<!-- Balance -->
- <c:PrivacyContentControl PrivacyReplacementMode="Text" DataContext="{Binding Balance}" DockPanel.Dock="Top" HorizontalAlignment="Center" NumberOfPrivacyChars="0">
+ <c:PrivacyContentControl PrivacyReplacementMode="Text" DockPanel.Dock="Top" HorizontalAlignment="Center" NumberOfPrivacyChars="0">
<StackPanel Spacing="5" Orientation="Horizontal" VerticalAlignment="Top">
<TextBlock Opacity="0.6" Classes="h8" Text="Balance: " />
- <TextBlock Opacity="0.6" Classes="h8" Text="{Binding BalanceBtc}" />
- <TextBlock Opacity="0.6" Classes="h8" Text="{Binding BalanceFiat}" />
+ <Button Focusable="False" Classes="plainHyperlink h8" Command="{Binding InsertMaxCommand}">
+ <Panel>
+ <TextBlock Opacity="0.6" Classes="h8" Text="{Binding Balance.BalanceBtc}" />
+ </Panel>
+ </Button>
+ <TextBlock Opacity="0.6" Classes="h8" Text="{Binding Balance.BalanceFiat}" />
</StackPanel>
</c:PrivacyContentControl>
</StackPanel>

Add option to send whole balance