When a wallet is opened open a particular class depending on type.
Later we can use this to provide custom actions or restrict / overide UI if the wallettype is different.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml
<TextBlock Text="{Binding Title}" />
</StackPanel>
</TreeDataTemplate>
+ <TreeDataTemplate DataType="ViewModels:HardwareWalletViewModel" ItemsSource="{Binding Actions}">
+ <StackPanel Classes="TreeViewRoot">
+ <DrawingPresenter Width="16" Height="16" Drawing="{DynamicResource WalletExplorer_OpenHardwareWallet}" />
+ <TextBlock Text="{Binding Title}" />
+ </StackPanel>
+ </TreeDataTemplate>
+ <TreeDataTemplate DataType="ViewModels:WatchOnlyWalletViewModel" ItemsSource="{Binding Actions}">
+ <StackPanel Classes="TreeViewRoot">
+ <DrawingPresenter Width="16" Height="16" Drawing="{DynamicResource WalletExplorer_WatchOnlyOpenWallet}" />
+ <TextBlock Text="{Binding Title}" />
+ </StackPanel>
+ </TreeDataTemplate>
<TreeDataTemplate DataType="ViewModels:SendTabViewModel">
<StackPanel Classes="TreeViewRoot">
<DrawingPresenter Width="16" Height="16" Drawing="{DynamicResource WalletExplorerView_Send}" />

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
@@ -190,6 +190,22 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
}
+ private static WalletViewModel CreateWalletViewModel (Wallet wallet)
+ {
+ if(wallet.KeyManager.IsHardwareWallet)
+ {
+ return new HardwareWalletViewModel(wallet);
+ }
+ else if(wallet.KeyManager.IsWatchOnly)
+ {
+ return new WatchOnlyWalletViewModel(wallet);
+ }
+ else
+ {
+ return new WalletViewModel(wallet);
+ }
+ }
+
internal WalletViewModelBase OpenWallet(Wallet wallet)
{
if (_wallets.OfType<WalletViewModel>().Any(x => x.Title == wallet.WalletName))
@@ -197,7 +213,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
throw new Exception("Wallet already opened.");
}
- var walletViewModel = new WalletViewModel(wallet);
+ var walletViewModel = CreateWalletViewModel(wallet);
InsertWallet(walletViewModel);

When a wallet is opened open a particular class depending on type.

Later we can use this to provide custom actions or restrict / overide UI if the wallettype is different.