Fixed small visual bugs

This commit is contained in:
Daniel Schick 2025-08-05 09:05:11 +02:00
parent 82c01c8936
commit 973b0c267c
4 changed files with 7 additions and 5 deletions

View File

@ -8,6 +8,7 @@ using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
using System.Windows.Threading;
namespace ENI2.Controls namespace ENI2.Controls
{ {
@ -161,8 +162,9 @@ namespace ENI2.Controls
} }
if (!abort) if (!abort)
{ {
var tabControl = Parent as ItemsControl; var tabControl = Parent as TabControl;
tabControl.Items.Remove(this); tabControl.SelectedItem = null;
_ = Dispatcher.BeginInvoke(new Action(() => tabControl.Items.Remove(this)), DispatcherPriority.Background);
} }
}; };
dockPanel.Children.Add(closeButton); dockPanel.Children.Add(closeButton);

View File

@ -12,7 +12,7 @@
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800"> d:DesignHeight="600" d:DesignWidth="800">
<GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.textPortCall}"> <GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.textPortCall}">
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel"> <ScrollViewer>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="300" /> <RowDefinition Height="300" />

View File

@ -66,7 +66,7 @@
</Setter> </Setter>
</Style> </Style>
<Style TargetType="{x:Type enictrl:ClosableTabItem}"> <Style TargetType="{x:Type enictrl:ClosableTabItem}" BasedOn="{StaticResource {x:Type TabItem}}">
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type enictrl:ClosableTabItem}"> <ControlTemplate TargetType="{x:Type enictrl:ClosableTabItem}">