Hide Exchange Rate when it isn't available.
MODIFY
WalletWasabi.Gui/Controls/StatusBar.xaml
WalletWasabi.Gui/Controls/StatusBar.xaml
<TextBlock Text="{Binding Peers, StringFormat=Peers: \{0\}}" Foreground="{Binding Peers, ConverterParameter=Peers, Converter={StaticResource StatusColorConverter}}" />
</StackPanel>
</Panel>
- <StackPanel Orientation="Horizontal" Spacing="0">
+ <StackPanel IsVisible="{Binding IsExchangeRateAvailable}" Orientation="Horizontal" Spacing="0">
<TextBlock Text="BTC/USD: " />
- <TextBlock Text="{Binding BtcPrice}" />
+ <TextBlock Text="{Binding ExchangeRate}" />
</StackPanel>
</StackPanel>

MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -31,8 +31,6 @@ namespace WalletWasabi.Gui.ViewModels
{
public class StatusBarViewModel : ViewModelBase
{
- private const string LoadingText = "Loading ...";
-
private RpcStatus _bitcoinCoreStatus;
private UpdateStatus _updateStatus;
private bool _updateAvailable;
@@ -43,7 +41,8 @@ namespace WalletWasabi.Gui.ViewModels
private TorStatus _tor;
private int _peers;
private ObservableAsPropertyHelper<int> _filtersLeft;
- private string _btcPrice;
+ private string _exchangeRate;
+ private bool _isExchangeRateAvailable;
private ObservableAsPropertyHelper<string> _status;
private bool _downloadingBlock;
@@ -64,7 +63,8 @@ namespace WalletWasabi.Gui.ViewModels
UseTor = false;
Tor = TorStatus.NotRunning;
Peers = 0;
- _btcPrice = LoadingText;
+ ExchangeRate = "";
+ IsExchangeRateAvailable = false;
ActiveStatuses = new StatusSet();
}
@@ -141,13 +141,19 @@ namespace WalletWasabi.Gui.ViewModels
set => this.RaiseAndSetIfChanged(ref _criticalUpdateAvailable, value);
}
- public string BtcPrice
+ public string ExchangeRate
+ {
+ get => _exchangeRate;
+ set => this.RaiseAndSetIfChanged(ref _exchangeRate, value);
+ }
+
+ public bool IsExchangeRateAvailable
{
- get => _btcPrice;
- set => this.RaiseAndSetIfChanged(ref _btcPrice, value);
+ get => _isExchangeRateAvailable;
+ set => this.RaiseAndSetIfChanged(ref _isExchangeRateAvailable, value);
}
- public string Status => _status?.Value ?? LoadingText;
+ public string Status => _status?.Value ?? "Loading...";
public bool DownloadingBlock
{
@@ -263,7 +269,13 @@ namespace WalletWasabi.Gui.ViewModels
Synchronizer.WhenAnyValue(x => x.UsdExchangeRate)
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(usd => BtcPrice = usd == default ? LoadingText : $"${(long)usd}")
+ .Subscribe(usd => ExchangeRate = $"${(long)usd}")
+ .DisposeWith(Disposables);
+
+ Synchronizer.WhenAnyValue(x => x.UsdExchangeRate)
+ .Select(x => x != default)
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(x => IsExchangeRateAvailable = x)
.DisposeWith(Disposables);
if (rpcMonitor is { })

Hide Exchange Rate when it isn't available.