Simplify changes
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -82,15 +82,7 @@ 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);
- }
- });
+ InsertMaxCommand = ReactiveCommand.Create(() => AmountBtc = _wallet.Coins.TotalAmount().ToDecimal(MoneyUnit.BTC));
QrCommand = ReactiveCommand.Create(async () =>
{
ShowQrCameraDialogViewModel dialog = new(_wallet.Network);

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="10" VerticalAlignment="Center">
<!-- Balance -->
<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: " />
<Button Focusable="False" Classes="plainHyperlink h8" Command="{Binding InsertMaxCommand}">
- <Panel>
- <TextBlock Opacity="0.6" Classes="h8" Text="{Binding Balance.BalanceBtc}" />
- </Panel>
+ <TextBlock DataContext="{Binding Balance}" Opacity="0.6">
+ <TextBlock.Text>
+ <MultiBinding StringFormat="Balance: {0} {1}">
+ <Binding Path="BalanceBtc" />
+ <Binding Path="BalanceFiat" />
+ </MultiBinding>
+ </TextBlock.Text>
+ </TextBlock>
</Button>
- <TextBlock Opacity="0.6" Classes="h8" Text="{Binding Balance.BalanceFiat}" />
- </StackPanel>
</c:PrivacyContentControl>
</StackPanel>
</DockPanel>

Simplify changes