Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ui:Page
<ui:Page
x:Class="iNKORE.UI.WPF.Modern.Gallery.Pages.Controls.Windows.ItemsRepeaterPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand Down Expand Up @@ -183,7 +183,7 @@
</FrameworkElement.Resources>


<TabControl x:Name="tabControl" Style="{StaticResource TabControlPivotStyle}">
<TabControl x:Name="tabControl" Style="{StaticResource TabControlPivotStyle}" SelectionChanged="TabControl_SelectionChanged">
<TabControl.Resources>
<Thickness x:Key="PivotItemMargin">12,0,12,20</Thickness>
</TabControl.Resources>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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()
{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ui:Page
<ui:Page
x:Class="iNKORE.UI.WPF.Modern.Gallery.Pages.Controls.Windows.ListViewPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand Down Expand Up @@ -64,7 +64,7 @@
</Style>
</Page.Resources>

<TabControl x:Name="tabControl" Style="{StaticResource TabControlPivotStyle}">
<TabControl x:Name="tabControl" Style="{StaticResource TabControlPivotStyle}" SelectionChanged="TabControl_SelectionChanged">
<TabControl.Resources>
<Thickness x:Key="PivotItemMargin">12,0,12,20</Thickness>
</TabControl.Resources>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
Expand All @@ -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();
Expand Down
Loading