show watermark when empty.
MODIFY
WalletWasabi.Fluent/Controls/CurrencyEntryBox.axaml
WalletWasabi.Fluent/Controls/CurrencyEntryBox.axaml
Opacity="0.5"
Margin="5 0 0 0"
Text="{TemplateBinding CurrencyCode}"
+ IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</StackPanel>

MODIFY
WalletWasabi.Fluent/Controls/CurrencyEntryBox.axaml.cs
WalletWasabi.Fluent/Controls/CurrencyEntryBox.axaml.cs
@@ -44,7 +44,8 @@ namespace WalletWasabi.Fluent.Controls
{
this.GetObservable(TextProperty).Subscribe(_ => DoConversion());
this.GetObservable(ConversionRateProperty).Subscribe(_ => DoConversion());
- Text = "0";
+ Watermark = "0 BTC";
+ Text = string.Empty;
_customCultureInfo = new CultureInfo("")
{
@@ -73,14 +74,24 @@ namespace WalletWasabi.Fluent.Controls
_allowConversions = false;
if (IsConversionReversed)
+ {
+ if (!string.IsNullOrWhiteSpace(Text))
{
Text = $"{FormatBtc(Conversion)}";
}
+
+ Watermark = "0 BTC";
+ }
else
+ {
+ if (!string.IsNullOrWhiteSpace(Text))
{
Text = $"{FormatFiat(Conversion)}";
}
+ Watermark = $"0.00 {ConversionCurrencyCode}";
+ }
+
IsConversionReversed = !IsConversionReversed;
_allowConversions = true;
@@ -95,7 +106,7 @@ namespace WalletWasabi.Fluent.Controls
{
base.OnGotFocus(e);
- CaretIndex = Text.Length;
+ CaretIndex = Text?.Length ?? 0;
Dispatcher.UIThread.Post(() => SelectAll());
}
@@ -227,8 +238,8 @@ namespace WalletWasabi.Fluent.Controls
else
{
Conversion = 0;
- ConversionText = string.Empty;
- CurrencyCode = "";
+ ConversionText = $"0 BTC";
+ CurrencyCode = ConversionCurrencyCode;
}
}
else
@@ -246,8 +257,8 @@ namespace WalletWasabi.Fluent.Controls
else
{
Conversion = 0;
- ConversionText = string.Empty;
- CurrencyCode = "";
+ ConversionText = $"0.00 {ConversionCurrencyCode}";
+ CurrencyCode = "BTC";
}
}
}

show watermark when empty.