diff --git a/ENI2/Controls/ClosableTabItem.cs b/ENI2/Controls/ClosableTabItem.cs index 07a332ca..93a6cd34 100644 --- a/ENI2/Controls/ClosableTabItem.cs +++ b/ENI2/Controls/ClosableTabItem.cs @@ -8,6 +8,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Animation; +using System.Windows.Threading; namespace ENI2.Controls { @@ -161,8 +162,9 @@ namespace ENI2.Controls } if (!abort) { - var tabControl = Parent as ItemsControl; - tabControl.Items.Remove(this); + var tabControl = Parent as TabControl; + tabControl.SelectedItem = null; + _ = Dispatcher.BeginInvoke(new Action(() => tabControl.Items.Remove(this)), DispatcherPriority.Background); } }; dockPanel.Children.Add(closeButton); diff --git a/ENI2/DetailViewControls/PortCallDetailControl.xaml b/ENI2/DetailViewControls/PortCallDetailControl.xaml index ec501312..4758f600 100644 --- a/ENI2/DetailViewControls/PortCallDetailControl.xaml +++ b/ENI2/DetailViewControls/PortCallDetailControl.xaml @@ -12,7 +12,7 @@ mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="800"> - + diff --git a/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs b/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs index f04d766a..53d29001 100644 --- a/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/PortCallDetailControl.xaml.cs @@ -424,6 +424,6 @@ namespace ENI2.DetailViewControls } #endregion - + } } diff --git a/ENI2/Themes/Generic.xaml b/ENI2/Themes/Generic.xaml index e1dfe63a..94ed407a 100644 --- a/ENI2/Themes/Generic.xaml +++ b/ENI2/Themes/Generic.xaml @@ -66,7 +66,7 @@ -