Persist Fiat<->BTC setting on CurrencyEntryBox
MODIFY
WalletWasabi.Fluent/Controls/CurrencyEntryBox.axaml.cs
WalletWasabi.Fluent/Controls/CurrencyEntryBox.axaml.cs
@@ -372,8 +372,6 @@ public class CurrencyEntryBox : TextBox
private void SwapButtonOnClick(object? sender, RoutedEventArgs e)
{
IsConversionReversed = !IsConversionReversed;
- UpdateDisplay(true);
- CaretIndex = SelectionStart = SelectionEnd = Text.Length;
}
private void InputText(string text)
@@ -487,6 +485,10 @@ public class CurrencyEntryBox : TextBox
else if (change.Property == ConversionRateProperty)
{
PseudoClasses.Set(":noexchangerate", change.NewValue.GetValueOrDefault<decimal>() == 0m);
+ } else if (change.Property == IsConversionReversedProperty)
+ {
+ UpdateDisplay(true);
+ CaretIndex = SelectionStart = SelectionEnd = Text.Length;
}
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -41,6 +41,8 @@ public partial class SendViewModel : RoutableViewModel
[AutoNotify] private bool _isFixedAmount;
[AutoNotify] private bool _isPayJoin;
[AutoNotify] private string? _payJoinEndPoint;
+ [AutoNotify] private bool _conversionReversed;
+
private bool _parsingUrl;
private BitcoinAddress? _currentAddress;

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/SendView.axaml
<DockPanel>
<Image Width="120" Source="avares://WalletWasabi.Fluent/Assets/TechnologyLogos/payjoin.png"
DockPanel.Dock="Right" IsVisible="{Binding IsPayJoin}" Margin="0 8 8 0" VerticalAlignment="Top" />
- <c:CurrencyEntryBox KeyboardNavigation.IsTabStop="{Binding !IsFixedAmount}" x:Name="amountTb"
- IsReadOnly="{Binding IsFixedAmount}" AmountBtc="{Binding AmountBtc}"
- ConversionRate="{Binding ExchangeRate}" ConversionCurrencyCode="USD" />
+ <c:CurrencyEntryBox x:Name="amountTb"
+ KeyboardNavigation.IsTabStop="{Binding !IsFixedAmount}"
+ IsReadOnly="{Binding IsFixedAmount}"
+ AmountBtc="{Binding AmountBtc}"
+ ConversionRate="{Binding ExchangeRate}"
+ ConversionCurrencyCode="USD"
+ IsConversionReversed="{Binding ConversionReversed, Mode=TwoWay}" />
</DockPanel>
</DockPanel>

Persist Fiat<->BTC setting on CurrencyEntryBox