Address review comments + select already opened tab for the same coin.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinInfoTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/CoinInfoTabView.xaml
<Setter Property="Background" Value="Transparent" />
</Style>
</UserControl.Styles>
- <controls:GroupBox Title="{Binding Title}" Padding="20" Margin="10">
+ <controls:GroupBox Title="{Binding Title}" DataContext="{Binding Coin}" Padding="20" Margin="10">
<Grid HorizontalAlignment="Left" ColumnDefinitions="150, *" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
<TextBlock Classes="monospaceFont" Text="Transaction Id:" Grid.Row="0" />
- <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Coin.TransactionId}" Background="Transparent" Grid.Column="1" Grid.Row="0" />
+ <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding TransactionId}" Background="Transparent" Grid.Column="1" Grid.Row="0" />
<TextBlock Classes="monospaceFont" Text="Output Index:" Grid.Row="1" />
- <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Coin.OutputIndex}" Grid.Column="1" Grid.Row="1" />
+ <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding OutputIndex}" Grid.Column="1" Grid.Row="1" />
<TextBlock Classes="monospaceFont" Text="Address:" Grid.Row="2" />
- <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Coin.Address}" Grid.Column="1" Grid.Row="2" />
+ <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Address}" Grid.Column="1" Grid.Row="2" />
<TextBlock Classes="monospaceFont" Text="Confirmations:" Grid.Row="3" />
- <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Coin.Confirmations}" Grid.Column="1" Grid.Row="3" />
+ <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Confirmations}" Grid.Column="1" Grid.Row="3" />
<TextBlock Classes="monospaceFont" Text="Anonymity Set:" Grid.Row="4" />
- <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Coin.AnonymitySet}" Grid.Column="1" Grid.Row="4" />
+ <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding AnonymitySet}" Grid.Column="1" Grid.Row="4" />
<TextBlock Classes="monospaceFont" Text="Key Path:" Grid.Row="5" />
- <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Coin.KeyPath}" Grid.Column="1" Grid.Row="5" />
+ <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding KeyPath}" Grid.Column="1" Grid.Row="5" />
<TextBlock Classes="monospaceFont" Text="Public Key:" Grid.Row="6" />
- <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding Coin.PubKey}" Grid.Column="1" Grid.Row="6" />
+ <controls:ExtendedTextBox Classes="selectableTextBlock monospaceFont Transparent" Text="{Binding PubKey}" Grid.Column="1" Grid.Row="6" />
</Grid>
</controls:GroupBox>
</UserControl>
\ No newline at end of file

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinInfoTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinInfoTabViewModel.cs
-using System;
-using System.Collections.Generic;
-using System.Reactive.Disposables;
-using System.Reflection;
-using Splat;
using WalletWasabi.Gui.ViewModels;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
public class CoinInfoTabViewModel : WasabiDocumentTabViewModel
{
- public CoinInfoTabViewModel(string title, CoinViewModel coin) : base(title)
+ public CoinInfoTabViewModel(CoinViewModel coin) : base(string.Empty)
{
Coin = coin;
+ Title = $"{coin.TransactionId[0..10]}'s Details";
}
public CoinViewModel Coin { get; }

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
@@ -119,9 +119,17 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
OpenCoinInfo = ReactiveCommand.Create(() =>
{
- var title = $"{TransactionId[0..10]}'s Details";
- var advancedDetail = new CoinInfoTabViewModel(title, this);
- IoC.Get<IShell>().AddOrSelectDocument(advancedDetail);
+ var shell = IoC.Get<IShell>();
+
+ var coinInfo = shell.Documents?.OfType<CoinInfoTabViewModel>()?.FirstOrDefault(x => x.Coin?.TransactionId == TransactionId);
+
+ if (coinInfo is null)
+ {
+ coinInfo = new CoinInfoTabViewModel(this);
+ shell.AddDocument(coinInfo);
+ }
+
+ shell.Select(coinInfo);
});
ToggleDetails.ThrownExceptions
@@ -132,10 +140,10 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
NotificationHelpers.Error(ex.ToUserFriendlyString());
});
- Observable.Merge(DequeueCoin.ThrownExceptions)
+ Observable.Merge(DequeueCoin.ThrownExceptions) // Don't notify about it. Dequeue failure (and success) is notified by other mechanism.
.Merge(OpenCoinInfo.ThrownExceptions)
.ObserveOn(RxApp.TaskpoolScheduler)
- .Subscribe(ex => Logger.LogError(ex)); // Don't notify about it. Dequeue failure (and success) is notified by other mechanism.
+ .Subscribe(ex => Logger.LogError(ex));
}
public SmartCoin Model { get; }

Address review comments + select already opened tab for the same coin.