Better design.
ADD
WalletWasabi.Gui/Controls/WalletExplorer/PinPadView.xaml.cs
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace WalletWasabi.Gui.Controls.WalletExplorer
+{
+ public class PinPadView : UserControl
+ {
+ public PinPadView()
+ {
+ this.InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+ }
+}

ADD
WalletWasabi.Gui/Controls/WalletExplorer/PinPadViewModel.cs
+using System;
+using System.Collections.Generic;
+using System.Reactive.Disposables;
+using System.Text;
+
+namespace WalletWasabi.Gui.Controls.WalletExplorer
+{
+ internal class PinPadViewModel : WalletActionViewModel
+ {
+ private CompositeDisposable Disposables { get; set; }
+
+ public PinPadViewModel(WalletViewModel walletViewModel) : base("Pin Pad", walletViewModel)
+ {
+ }
+
+ public override void OnOpen()
+ {
+ base.OnOpen();
+
+ if (Disposables != null)
+ {
+ throw new Exception("Pin Pad Tab was opened before it was closed.");
+ }
+
+ Disposables = new CompositeDisposable();
+ }
+
+ public override bool OnClose()
+ {
+ Disposables.Dispose();
+ Disposables = null;
+
+ return base.OnClose();
+ }
+ }
+}

Better design.