Permalink
Browse files

Merge branch 'label'

  • Loading branch information...
nopara73 committed Nov 9, 2018
2 parents eb459e6 + 072ed01 commit eece3d8f6b8c00f995257aac55032bd0cde968cb
@@ -25,11 +25,7 @@
<StackPanel DockPanel.Dock="Bottom" Margin="0 10" Spacing="10" HorizontalAlignment="Left">
<TextBlock>Note that, you must select coins you want to spend from.</TextBlock>
<controls:ExtendedTextBox Text="{Binding Address}" Watermark="Address" UseFloatingWatermark="True" />
<controls:ExtendedTextBox Text="{Binding Label}" Watermark="Label" UseFloatingWatermark="True">
<ToolTip.Tip>
Start labelling today and your privacy will thank you tomorrow!
</ToolTip.Tip>
</controls:ExtendedTextBox>
<controls:ExtendedTextBox Text="{Binding Label}" Watermark="Label" UseFloatingWatermark="True" IsReadOnly="{Binding IsMax}" ToolTip.Tip="{Binding LabelToolTip}" />
<StackPanel Orientation="Horizontal" Spacing="10">
<Button Content="{Binding MaxClear}" Command="{Binding MaxCommand}" VerticalAlignment="Top" />
<controls:ExtendedTextBox Foreground="{Binding IsMax, Converter={StaticResource AmountForegroundConverter}}" IsReadOnly="{Binding IsMax}" Text="{Binding Amount}" Watermark="Amount (BTC)" UseFloatingWatermark="True" MinWidth="124" MinHeight="46" />
@@ -29,6 +29,7 @@ public class SendTabViewModel : WalletActionViewModel
private string _password;
private string _address;
private string _label;
private string _labelToolTip;
private bool _isBusy;
private string _warningMessage;
private string _successMessage;
@@ -93,7 +94,7 @@ public SendTabViewModel(WalletViewModel walletViewModel)
try
{
Password = Guard.Correct(Password);
if (string.IsNullOrWhiteSpace(Label))
if (!IsMax && string.IsNullOrWhiteSpace(Label))
{
throw new InvalidOperationException("Label is required.");
}
@@ -193,6 +194,8 @@ private void SetMax()
IgnoreAmountChanges = true;
Amount = "All Selected Coins!";
IgnoreAmountChanges = false;
LabelToolTip = "Spending whole coins doesn't generate change, thus labeling is unnecessary.";
}
private void ResetMax()
@@ -203,6 +206,8 @@ private void ResetMax()
IgnoreAmountChanges = true;
Amount = "0.0";
IgnoreAmountChanges = false;
LabelToolTip = "Start labelling today and your privacy will thank you tomorrow!";
}
public CoinListViewModel CoinList
@@ -289,6 +294,12 @@ public string Label
set { this.RaiseAndSetIfChanged(ref _label, value); }
}
public string LabelToolTip
{
get { return _labelToolTip; }
set { this.RaiseAndSetIfChanged(ref _labelToolTip, value); }
}
public string WarningMessage
{
get { return _warningMessage; }

0 comments on commit eece3d8

Please sign in to comment.