separate history item and transaction details
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItemViewModel.cs
using System;
using NBitcoin;
-using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Transactions;
using WalletWasabi.Models;
using WalletWasabi.Stores;
@@ -11,15 +10,14 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
{
public HistoryItemViewModel(int orderIndex, TransactionSummary transactionSummary, BitcoinStore bitcoinStore, Money balance)
{
+ TransactionSummary = transactionSummary;
Date = transactionSummary.DateTime.ToLocalTime();
IsCoinJoin = transactionSummary.IsLikelyCoinJoinOutput;
OrderIndex = orderIndex;
Balance = balance;
- Labels = transactionSummary.Label;
- TransactionId = transactionSummary.TransactionId.ToString();
- BlockHeight = transactionSummary.Height.Type == HeightType.Chain ? transactionSummary.Height.Value : 0;
- Confirmations = transactionSummary.Height.Type == HeightType.Chain ? (int) bitcoinStore.SmartHeaderChain.TipHeight - transactionSummary.Height.Value + 1 : 0;
- IsConfirmed = Confirmations > 0;
+
+ var confirmations = transactionSummary.Height.Type == HeightType.Chain ? (int) bitcoinStore.SmartHeaderChain.TipHeight - transactionSummary.Height.Value + 1 : 0;
+ IsConfirmed = confirmations > 0;
var amount = transactionSummary.Amount;
if (amount < 0)
@@ -32,13 +30,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
}
}
- public int Confirmations { get; }
-
- public int BlockHeight { get; }
-
- public string TransactionId { get; set; }
-
- public SmartLabel Labels { get; set; }
+ public TransactionSummary TransactionSummary { get; }
public int OrderIndex { get; }

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
@@ -56,7 +56,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
return;
}
- Navigate(NavigationTarget.DialogScreen).To(new TransactionDetailsViewModel(selectedItem));
+ Navigate(NavigationTarget.DialogScreen).To(new TransactionDetailsViewModel(selectedItem.TransactionSummary, _bitcoinStore));
});
this.WhenAnyValue(x => x.SelectedItem)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/TransactionDetailsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/TransactionDetailsViewModel.cs
+using System;
+using NBitcoin;
using ReactiveUI;
+using WalletWasabi.Blockchain.Analysis.Clustering;
+using WalletWasabi.Blockchain.Transactions;
using WalletWasabi.Fluent.ViewModels.Navigation;
+using WalletWasabi.Models;
+using WalletWasabi.Stores;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
{
[NavigationMetaData(Title = "Transaction Details")]
public partial class TransactionDetailsViewModel : RoutableViewModel
{
- public TransactionDetailsViewModel(HistoryItemViewModel historyItem)
+ public TransactionDetailsViewModel(TransactionSummary transactionSummary, BitcoinStore bitcoinStore)
{
- HistoryItem = historyItem;
+ Date = transactionSummary.DateTime.ToLocalTime();
+ TransactionId = transactionSummary.TransactionId.ToString();
+ Labels = transactionSummary.Label;
+ BlockHeight = transactionSummary.Height.Type == HeightType.Chain ? transactionSummary.Height.Value : 0;
+ Confirmations = transactionSummary.Height.Type == HeightType.Chain ? (int) bitcoinStore.SmartHeaderChain.TipHeight - transactionSummary.Height.Value + 1 : 0;
+ IsConfirmed = Confirmations > 0;
+ Amount = transactionSummary.Amount;
NextCommand = ReactiveCommand.Create(OnNext);
}
+ public Money Amount { get; set; }
+
+ public bool IsConfirmed { get; set; }
+
+ public int Confirmations { get; set; }
+
+ public int BlockHeight { get; set; }
+
+ public SmartLabel Labels { get; set; }
+
+ public string TransactionId { get; set; }
+
+ public DateTimeOffset Date { get; set; }
+
private void OnNext()
{
Navigate().Clear();
}
-
- public HistoryItemViewModel HistoryItem { get; }
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/TransactionDetailsView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/TransactionDetailsView.axaml
<c:ContentArea Title="{Binding Title}"
NextContent="Done" EnableNext="True"
EnableCancel="{Binding EnableCancel}">
- <StackPanel Spacing="15" DataContext="{Binding HistoryItem}">
+ <StackPanel Spacing="15">
<!-- Date -->
<c:PreviewItem Icon="{StaticResource timer_regular}"
Text="Date / Time"
Content="{Binding Date, StringFormat='{}{0:MM/dd/yyyy HH:mm}'}" />
+
<Separator />
<!-- Transaction ID -->
<c:PreviewItem Icon="{StaticResource transaction_id}"
Text="Transaction ID"
Content="{Binding TransactionId}" />
+
<Separator />
<!-- Status -->
<TextBlock Text="Pending" IsVisible="{Binding !IsConfirmed}" />
</Panel>
</c:PreviewItem>
+
<Separator />
<!-- Incoming amount -->
<c:PreviewItem Icon="{StaticResource btc_logo}"
- Text="Incoming amount"
- Content="{Binding IncomingAmount, StringFormat={}{0} BTC}"
- IsVisible="{Binding !!IncomingAmount}"/>
- <Separator IsVisible="{Binding !!IncomingAmount}" />
+ Text="Amount"
+ Content="{Binding Amount, StringFormat={}{0} BTC}"/>
- <!-- Outgoing amount -->
- <c:PreviewItem Icon="{StaticResource btc_logo}"
- Text="Outgoing amount"
- Content="{Binding OutgoingAmount, StringFormat={}{0} BTC}"
- IsVisible="{Binding !!OutgoingAmount}" />
- <Separator IsVisible="{Binding !!OutgoingAmount}" />
+ <Separator />
<!-- Block height -->
<c:PreviewItem Icon="{StaticResource block_height}"
<c:PreviewItem Icon="{StaticResource copy_confirmed}"
Text="Confirmations"
Content="{Binding Confirmations}" />
+
<Separator />
<!-- Labels -->

separate history item and transaction details