bind exchange rate so it updates in realtime.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
+using System;
using System.Collections.Generic;
+using System.Reactive.Disposables;
using System.Windows.Input;
using Avalonia;
using NBitcoin;
@@ -20,11 +22,17 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
NavigationTarget = NavigationTarget.HomeScreen)]
public partial class SendViewModel : NavBarItemViewModel
{
+ private WalletViewModel _owner;
[AutoNotify] private string _to;
[AutoNotify] private decimal _amountBtc;
+ [AutoNotify] private decimal _exchangeRate;
public SendViewModel(WalletViewModel walletVm)
{
+ _owner = walletVm;
+
+ ExchangeRate = walletVm.Wallet.Synchronizer.UsdExchangeRate;
+
PasteCommand = ReactiveCommand.CreateFromTask(async () =>
{
var text = await Application.Current.Clipboard.GetTextAsync();
@@ -59,6 +67,15 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
});
}
+ protected override void OnNavigatedTo(bool inStack, CompositeDisposable disposables)
+ {
+ _owner.Wallet.Synchronizer.WhenAnyValue(x => x.UsdExchangeRate)
+ .Subscribe(x => ExchangeRate = x)
+ .DisposeWith(disposables);
+
+ base.OnNavigatedTo(inStack, disposables);
+ }
+
public ICommand PasteCommand { get; }
public double XAxisCurrentValue { get; set; } = 36;

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
<DockPanel>
<Label DockPanel.Dock="Left" Content="_Amount:" Target="amountTb" />
- <c:CurrencyEntryBox x:Name="amountTb" ConversionRate="32212.00" ConversionCurrencyCode="USD" />
+ <c:CurrencyEntryBox x:Name="amountTb" ConversionRate="{Binding ExchangeRate}" ConversionCurrencyCode="USD" />
</DockPanel>
<DockPanel>

bind exchange rate so it updates in realtime.