diff --git a/src/WPFDevelopers.Samples.Shared/ExampleViews/BasicControlsExample.xaml b/src/WPFDevelopers.Samples.Shared/ExampleViews/BasicControlsExample.xaml index b216fc5c..fccc5e44 100644 --- a/src/WPFDevelopers.Samples.Shared/ExampleViews/BasicControlsExample.xaml +++ b/src/WPFDevelopers.Samples.Shared/ExampleViews/BasicControlsExample.xaml @@ -779,32 +779,67 @@ - + - + - + - + - + + + + - + - + - + @@ -812,13 +847,22 @@ Margin="4" IsEnabled="False" TabStripPlacement="Right"> - + - + - + diff --git a/src/WPFDevelopers.Shared/Core/Helpers/ElementHelper.cs b/src/WPFDevelopers.Shared/Core/Helpers/ElementHelper.cs index f040e1ea..ea877d62 100644 --- a/src/WPFDevelopers.Shared/Core/Helpers/ElementHelper.cs +++ b/src/WPFDevelopers.Shared/Core/Helpers/ElementHelper.cs @@ -93,14 +93,17 @@ private static void ButtonClear_Click(object sender, RoutedEventArgs e) if (sender is Button button) { if (button.TemplatedParent is TextBox textBox) - { textBox.Clear(); - } else if (button.TemplatedParent is PasswordBox passwordBox) - { passwordBox.Clear(); + else if (button.TemplatedParent is TabItem tabItem) + { + var tabControl = tabItem.Parent as TabControl; + if (tabControl != null) + tabControl.Items.Remove(tabItem); } } } + } } \ No newline at end of file diff --git a/src/WPFDevelopers.Shared/Styles/Styles.TabControl.xaml b/src/WPFDevelopers.Shared/Styles/Styles.TabControl.xaml index 03820288..b0983557 100644 --- a/src/WPFDevelopers.Shared/Styles/Styles.TabControl.xaml +++ b/src/WPFDevelopers.Shared/Styles/Styles.TabControl.xaml @@ -2,7 +2,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:WPFDevelopers.Controls" - xmlns:helpers="clr-namespace:WPFDevelopers.Helpers"> + xmlns:helpers="clr-namespace:WPFDevelopers.Helpers" + xmlns:resx="clr-namespace:WPFDevelopers"> @@ -19,15 +20,52 @@ - + - + + + + + + + + + @@ -38,6 +76,28 @@ + + + + @@ -85,6 +145,8 @@