Change string to Money
MODIFY
WalletWasabi.Gui/Controls/TransactionDetails/ViewModels/TransactionDetailsViewModel.cs
WalletWasabi.Gui/Controls/TransactionDetails/ViewModels/TransactionDetailsViewModel.cs
@@ -17,8 +17,8 @@ namespace WalletWasabi.Gui.Controls.TransactionDetails.ViewModels
private string _label;
private int _blockHeight;
private string _transactionId;
- private string _totalInputValue;
- private string _totalOutputValue;
+ private Money _totalInputValue;
+ private Money _totalOutputValue;
private int _inputCount;
private int _outputCount;
@@ -64,13 +64,13 @@ namespace WalletWasabi.Gui.Controls.TransactionDetails.ViewModels
set => this.RaiseAndSetIfChanged(ref _transactionId, value);
}
- public string TotalInputValue
+ public Money TotalInputValue
{
get => _totalInputValue;
set => this.RaiseAndSetIfChanged(ref _totalInputValue, value);
}
- public string TotalOutputValue
+ public Money TotalOutputValue
{
get => _totalOutputValue;
set => this.RaiseAndSetIfChanged(ref _totalOutputValue, value);
@@ -111,8 +111,8 @@ namespace WalletWasabi.Gui.Controls.TransactionDetails.ViewModels
var outputAddressAmount = psbt.Outputs.Select(FromPSBTOutput);
- var totalInValue = inputAddressAmount.Select(x => x.Amount).Sum().ToString();
- var totalOutValue = outputAddressAmount.Select(x => x.Amount).Sum().ToString();
+ var totalInValue = inputAddressAmount.Select(x => x.Amount).Sum();
+ var totalOutValue = outputAddressAmount.Select(x => x.Amount).Sum();
var psbtTxn = psbt.GetOriginalTransaction();

MODIFY
WalletWasabi.Gui/Controls/TransactionDetails/Views/TransactionDetails.xaml
WalletWasabi.Gui/Controls/TransactionDetails/Views/TransactionDetails.xaml
<converters:BooleanStringConverter x:Key="BooleanStringConverter" />
<converters:LurkingWifeModeStringConverter x:Key="LurkingWifeModeStringConverter" />
<converters:MoneyBrushConverter x:Key="MoneyBrushConverter" />
+ <converters:MoneyStringConverter x:Key="MoneyStringConverter" />
</UserControl.Resources>
<Panel>
<StackPanel>
</Grid>
<Grid ColumnDefinitions="170, *">
<TextBlock Classes="monospaceFont" Text="Input Amount (BTC):" />
- <controls:ExtendedTextBox Grid.Column="1" Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding TotalInputValue}" Foreground="{Binding TotalInputValue, Converter={StaticResource MoneyBrushConverter}}" />
+ <controls:ExtendedTextBox Grid.Column="1" Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding TotalInputValue, Mode=OneWay, Converter={StaticResource MoneyStringConverter}}" Foreground="{Binding TotalInputValue, Converter={StaticResource MoneyBrushConverter}}" />
</Grid>
<Grid ColumnDefinitions="170, *">
<TextBlock Classes="monospaceFont" Text="Output Amount (BTC):" />
- <controls:ExtendedTextBox Grid.Column="1" Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding TotalOutputValue}" Foreground="{Binding TotalOutputValue, Converter={StaticResource MoneyBrushConverter}}" />
+ <controls:ExtendedTextBox Grid.Column="1" Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding TotalOutputValue, Mode=OneWay, Converter={StaticResource MoneyStringConverter}}" Foreground="{Binding TotalOutputValue, Converter={StaticResource MoneyBrushConverter}}" />
</Grid>
<Grid ColumnDefinitions="170, *">
<TextBlock Classes="monospaceFont" Text="Input Count:" />
<TextBlock Classes="monospaceFont" Text="Output Count:" />
<controls:ExtendedTextBox Grid.Column="1" Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Path=OutputCount, StringFormat=\{0\} Outputs(s)}" />
</Grid>
- <Grid ColumnDefinitions="170, *">
- <TextBlock Classes="monospaceFont" Text="Transaction Date:" />
- <controls:ExtendedTextBox Grid.Column="1" Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Path=DateTime, StringFormat=\{0:yyyy-MM-dd HH:mm\}}" />
- </Grid>
</StackPanel>
</Panel>
</UserControl>

Change string to Money