use simple props instead of autonotify
MODIFY
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcastTransactionViewModel.cs
WalletWasabi.Fluent/ViewModels/TransactionBroadcasting/BroadcastTransactionViewModel.cs
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Transactions;
+using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Logging;
@@ -21,13 +22,6 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting
NavigationTarget = NavigationTarget.DialogScreen)]
public partial class BroadcastTransactionViewModel : RoutableViewModel
{
- [AutoNotify] private string? _transactionId;
- [AutoNotify] private Money? _totalInputValue;
- [AutoNotify] private Money? _totalOutputValue;
- [AutoNotify] private int _inputCount;
- [AutoNotify] private int _outputCount;
- [AutoNotify] private Money? _networkFee;
-
public BroadcastTransactionViewModel(Network network, SmartTransaction transaction)
{
Title = "Broadcast Transaction";
@@ -51,6 +45,18 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting
ProcessTransaction(transaction, network);
}
+ public string? TransactionId { get; set; }
+
+ public string? OutputAmountString { get; set; }
+
+ public string? InputAmountString { get; set; }
+
+ public string? FeeString { get; set; }
+
+ public int InputCount { get; set; }
+
+ public int OutputCount { get; set; }
+
private void ProcessTransaction(SmartTransaction transaction, Network network)
{
var nullMoney = new Money(-1L);
@@ -74,18 +80,24 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcasting
var psbtTxn = psbt.GetOriginalTransaction();
- _transactionId = psbtTxn.GetHash().ToString();
- _inputCount = inputAddressAmount.Length;
- _outputCount = outputAddressAmount.Length;
- _totalInputValue = inputAddressAmount.Any(x => x.Value == nullMoney)
+ TransactionId = psbtTxn.GetHash().ToString();
+
+ InputCount = inputAddressAmount.Length;
+ var totalInputValue = inputAddressAmount.Any(x => x.Value == nullMoney)
? null
: inputAddressAmount.Select(x => x.Value).Sum();
- _totalOutputValue = outputAddressAmount.Any(x => x.Value == nullMoney)
+ InputAmountString = totalInputValue is null ? "Unknown" : $"{totalInputValue.ToFormattedString()} BTC";
+
+ OutputCount = outputAddressAmount.Length;
+ var totalOutputValue = outputAddressAmount.Any(x => x.Value == nullMoney)
? null
: outputAddressAmount.Select(x => x.Value).Sum();
- _networkFee = TotalInputValue is null || TotalOutputValue is null
+ OutputAmountString = totalOutputValue is null ? "Unknown" : $"{totalOutputValue.ToFormattedString()} BTC";
+
+ var networkFee = totalInputValue is null || totalOutputValue is null
? null
- : TotalInputValue - TotalOutputValue;
+ : totalInputValue - totalOutputValue;
+ FeeString = networkFee is null ? "Unknown" : $"{networkFee.ToFormattedString()} BTC";
}
private async Task OnNextAsync(SmartTransaction transaction)

MODIFY
WalletWasabi.Fluent/Views/TransactionBroadcasting/BroadcastTransactionView.axaml
WalletWasabi.Fluent/Views/TransactionBroadcasting/BroadcastTransactionView.axaml
<Separator />
<c:PreviewItem Icon="{StaticResource btc_logo}"
Text="Input amount"
- Content="{Binding TotalInputValue, Converter={x:Static converters:MoneyConverters.MoneyToString}, StringFormat={}{0} BTC,FallbackValue=0.00011234}" />
+ Content="{Binding InputAmountString, FallbackValue=0.00011234 BTC}" />
<Separator />
<c:PreviewItem Icon="{StaticResource btc_logo}"
- Text="Input amount"
- Content="{Binding TotalOutputValue, Converter={x:Static converters:MoneyConverters.MoneyToString}, StringFormat={}{0} BTC,FallbackValue=0.00011234}" />
+ Text="Output amount"
+ Content="{Binding OutputAmountString, FallbackValue=0.00011234 BTC}" />
<Separator />
<c:PreviewItem Icon="{StaticResource arrow_down_right_circle_regular}"
Text="Input count"
<Separator />
<c:PreviewItem Icon="{StaticResource paper_cash_regular}"
Text="Fee"
- Content="{Binding NetworkFee, Converter={x:Static converters:MoneyConverters.MoneyToString}, StringFormat={}{0} BTC,FallbackValue=0.00011234}" />
+ Content="{Binding FeeString, FallbackValue=0.00011234 BTC}" />
</StackPanel>
</c:ContentArea>
</UserControl>

use simple props instead of autonotify