Implement HistoryViewTab's Transaction Details tab.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabView.xaml
xmlns:behaviors="clr-namespace:WalletWasabi.Gui.Behaviors;assembly=WalletWasabi.Gui"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:converters="clr-namespace:WalletWasabi.Gui.Converters;assembly=WalletWasabi.Gui"
- xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui"
- x:Class="WalletWasabi.Gui.Controls.WalletExplorer.HistoryTabView">
+ xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui" x:Class="WalletWasabi.Gui.Controls.WalletExplorer.HistoryTabView">
<i:Interaction.Behaviors>
<behaviors:ClearPropertyOnLostFocusBehavior TargetProperty="{Binding SelectedTransaction}" />
</i:Interaction.Behaviors>
<controls:ExtendedListBox.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="40, 160, 150, *" Background="Transparent">
+ <i:Interaction.Behaviors>
+ <behaviors:CommandOnDoubleClickBehavior Command="{Binding OpenTransactionInfo}" />
+ </i:Interaction.Behaviors>
<Grid.ContextMenu>
<ContextMenu>
+ <MenuItem Header="Open Details" Command="{Binding OpenTransactionInfo}">
+ <MenuItem.Icon>
+ <DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource Add}" />
+ </MenuItem.Icon>
+ </MenuItem>
<MenuItem Header="Copy Transaction ID" Command="{Binding CopyTransactionId}">
<MenuItem.Icon>
<DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource CopyIcon}" />

ADD
WalletWasabi.Gui/Controls/WalletExplorer/TransactionInfoTabView.xaml.cs
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Data;
+using Avalonia.Markup.Xaml;
+using ReactiveUI;
+using System.Reactive.Linq;
+
+namespace WalletWasabi.Gui.Controls.WalletExplorer
+{
+ public class TransactionInfoTabView : UserControl
+ {
+ public TransactionInfoTabView()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+ }
+}

ADD
WalletWasabi.Gui/Controls/WalletExplorer/TransactionInfoTabViewModel.cs
+using WalletWasabi.Gui.ViewModels;
+
+namespace WalletWasabi.Gui.Controls.WalletExplorer
+{
+ public class TransactionInfoTabViewModel : WasabiDocumentTabViewModel
+ {
+ public TransactionInfoTabViewModel(TransactionViewModel transaction) : base(string.Empty)
+ {
+ Transaction = transaction;
+ Title = $"Transaction ({transaction.TransactionId[0..10]}) Details";
+ }
+
+ public TransactionViewModel Transaction { get; }
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewModel.cs
using Avalonia;
-using Avalonia.Threading;
using NBitcoin;
using ReactiveUI;
using System;
+using System.Linq;
using System.Globalization;
using System.Reactive;
using System.Reactive.Linq;
@@ -11,6 +11,8 @@ using System.Threading.Tasks;
using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;
+using AvalonStudio.Extensibility;
+using AvalonStudio.Shell;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
@@ -20,6 +22,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private bool _clipboardNotificationVisible;
private double _clipboardNotificationOpacity;
public ReactiveCommand<Unit, Unit> CopyTransactionId { get; }
+ public ReactiveCommand<Unit, Unit> OpenTransactionInfo { get; }
public TransactionViewModel(TransactionInfo model)
{
@@ -29,13 +32,31 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
CopyTransactionId = ReactiveCommand.CreateFromTask(TryCopyTxIdToClipboardAsync);
- CopyTransactionId.ThrownExceptions
+ OpenTransactionInfo = ReactiveCommand.Create(() =>
+ {
+ var shell = IoC.Get<IShell>();
+
+ var transactionInfo = shell.Documents?.OfType<TransactionInfoTabViewModel>()?.FirstOrDefault(x => x.Transaction?.TransactionId == TransactionId);
+
+ if (transactionInfo is null)
+ {
+ transactionInfo = new TransactionInfoTabViewModel(this);
+ shell.AddDocument(transactionInfo);
+ }
+
+ shell.Select(transactionInfo);
+ });
+
+ Observable
+ .Merge(CopyTransactionId.ThrownExceptions)
+ .Merge(OpenTransactionInfo.ThrownExceptions)
.ObserveOn(RxApp.TaskpoolScheduler)
.Subscribe(ex =>
{
Logger.LogError(ex);
NotificationHelpers.Error(ex.ToUserFriendlyString());
});
+
}
public void Refresh()

Implement HistoryViewTab's Transaction Details tab.