diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ItemsRepeaterPage.xaml b/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ItemsRepeaterPage.xaml index 0d93c415..781a79b4 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ItemsRepeaterPage.xaml +++ b/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ItemsRepeaterPage.xaml @@ -1,4 +1,4 @@ - - + 12,0,12,20 diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ItemsRepeaterPage.xaml.cs b/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ItemsRepeaterPage.xaml.cs index 02c38014..50d40f7c 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ItemsRepeaterPage.xaml.cs +++ b/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ItemsRepeaterPage.xaml.cs @@ -1,4 +1,4 @@ -using iNKORE.UI.WPF.Modern.Controls; +using iNKORE.UI.WPF.Modern.Controls; using iNKORE.UI.WPF.Modern.Gallery.Helpers; using System; using System.Collections.Generic; @@ -40,6 +40,19 @@ public ItemsRepeaterPage() Ex2_CustomLayout.RaiseEvent(new RoutedEventArgs(RadioButton.ClickEvent)); } + private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + FocusSelectedTabHeader(); + } + + private void FocusSelectedTabHeader() + { + if (tabControl.ItemContainerGenerator.ContainerFromIndex(tabControl.SelectedIndex) is TabItem tabItem) + { + tabItem.Focus(); + } + } + ~ItemsRepeaterPage() { } diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ListViewPage.xaml b/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ListViewPage.xaml index 664dbb2e..748700ee 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ListViewPage.xaml +++ b/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ListViewPage.xaml @@ -1,4 +1,4 @@ - - + 12,0,12,20 diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ListViewPage.xaml.cs b/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ListViewPage.xaml.cs index 7f578b61..1b97ac5b 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ListViewPage.xaml.cs +++ b/source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/ListViewPage.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; @@ -25,6 +25,19 @@ private async void OnLoaded(object sender, RoutedEventArgs e) DataContext = await Contact.GetContactsAsync(); } + private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + FocusSelectedTabHeader(); + } + + private void FocusSelectedTabHeader() + { + if (tabControl.ItemContainerGenerator.ContainerFromIndex(tabControl.SelectedIndex) is TabItem tabItem) + { + tabItem.Focus(); + } + } + private void RadioButtons_SelectionChanged(object sender, SelectionChangedEventArgs e) { UpdateExampleCode();