Rename Amount to AmountText
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/SendTabView.xaml
</StackPanel>
<StackPanel Orientation="Horizontal" Spacing="10">
<Button Content="{Binding IsMax, Converter={StaticResource BooleanStringConverter}, ConverterParameter=Clear:Max}" Command="{Binding MaxCommand}" VerticalAlignment="Top" Height="40" />
- <controls:ExtendedTextBox Foreground="{Binding Amount, Converter={StaticResource AmountForegroundConverter}}" IsReadOnly="{Binding IsMax}" Text="{Binding Amount}" ToolTip.Tip="{Binding AmountToolTip}" Watermark="{Binding AmountWatermarkText}" UseFloatingWatermark="True" MinWidth="124" MinHeight="46" />
+ <controls:ExtendedTextBox Foreground="{Binding AmountText,
+ Converter={StaticResource AmountForegroundConverter}}"
+ IsReadOnly="{Binding IsMax}" Text="{Binding AmountText}"
+ ToolTip.Tip="{Binding AmountToolTip}"
+ Watermark="{Binding AmountWatermarkText}"
+ UseFloatingWatermark="True"
+ MinWidth="124"
+ MinHeight="46" />
<StackPanel>
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock Text="Fee:" />

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -35,7 +35,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private string _buildTransactionButtonText;
private bool _isMax;
- private string _amount;
+ private string _amountText;
private int _feeTarget;
private int _minimumFeeTarget;
private int _maximumFeeTarget;
@@ -87,7 +87,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
UsdExchangeRate = Global.Synchronizer?.UsdExchangeRate ?? UsdExchangeRate;
IsMax = false;
LabelToolTip = "Start labeling today and your privacy will thank you tomorrow!";
- Amount = "0.0";
+ AmountText = "0.0";
}
public SendTabViewModel(WalletViewModel walletViewModel, bool isTransactionBuilder = false)
@@ -114,7 +114,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
FeeDisplayFormat = (FeeDisplayFormat)(Enum.ToObject(typeof(FeeDisplayFormat), Global.UiConfig.FeeDisplayFormat) ?? FeeDisplayFormat.SatoshiPerByte);
SetFeesAndTexts();
- this.WhenAnyValue(x => x.Amount)
+ this.WhenAnyValue(x => x.AmountText)
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(amount =>
{
@@ -142,7 +142,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
if (betterAmount != amount)
{
- Amount = betterAmount;
+ AmountText = betterAmount;
}
}
@@ -214,7 +214,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
else
{
- Amount = "0.0";
+ AmountText = "0.0";
LabelToolTip = "Start labeling today and your privacy will thank you tomorrow!";
}
@@ -261,7 +261,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
var amount = Money.Zero;
if (!IsMax)
{
- if (!Money.TryParse(Amount, out amount) || amount == Money.Zero)
+ if (!Money.TryParse(AmountText, out amount) || amount == Money.Zero)
{
SetWarningMessage($"Invalid amount.");
return;
@@ -387,7 +387,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
IsBusy = false;
}
},
- this.WhenAny(x => x.IsMax, x => x.Amount, x => x.Address, x => x.IsBusy,
+ this.WhenAny(x => x.IsMax, x => x.AmountText, x => x.Address, x => x.IsBusy,
(isMax, amount, address, busy) => (isMax.Value || !string.IsNullOrWhiteSpace(amount.Value)) && !string.IsNullOrWhiteSpace(Address) && !IsBusy)
.ObserveOn(RxApp.MainThreadScheduler));
}
@@ -634,11 +634,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
if (AllSelectedAmount == Money.Zero)
{
- Amount = "No Coins Selected";
+ AmountText = "No Coins Selected";
}
else
{
- Amount = $"~ {AllSelectedAmount.ToString(false, true)}";
+ AmountText = $"~ {AllSelectedAmount.ToString(false, true)}";
}
}
}
@@ -658,7 +658,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
else
{
- if (Money.TryParse(Amount.TrimStart('~', ' '), out Money amount))
+ if (Money.TryParse(AmountText.TrimStart('~', ' '), out Money amount))
{
var inNum = 0;
var amountSoFar = Money.Zero;
@@ -689,7 +689,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
else
{
- if (Money.TryParse(Amount.TrimStart('~', ' '), out Money amount) && amount.Satoshi != 0)
+ if (Money.TryParse(AmountText.TrimStart('~', ' '), out Money amount) && amount.Satoshi != 0)
{
FeePercentage = 100 * (decimal)EstimatedBtcFee.Satoshi / amount.Satoshi;
}
@@ -809,10 +809,10 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _isMax, value);
}
- public string Amount
+ public string AmountText
{
- get => _amount;
- set => this.RaiseAndSetIfChanged(ref _amount, value);
+ get => _amountText;
+ set => this.RaiseAndSetIfChanged(ref _amountText, value);
}
public int FeeTarget

Rename Amount to AmountText