Skip to content

Commit 1c3dc2d

Browse files
authored
Added tab navigation control in calendar (#9367)
* Added tab navigation control in calendar * Disabled tab navigation for month and year views
1 parent 70df0fb commit 1c3dc2d

File tree

1 file changed

+10
-6
lines changed
  • src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles

1 file changed

+10
-6
lines changed

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Calendar.xaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
<Setter.Value>
312312
<ControlTemplate TargetType="{x:Type CalendarItem}">
313313
<Grid x:Name="PART_Root" Margin="12">
314-
<Grid>
314+
<Grid KeyboardNavigation.TabNavigation="Cycle">
315315
<Grid.RowDefinitions>
316316
<RowDefinition Height="Auto" />
317317
<RowDefinition Height="*" />
@@ -333,13 +333,14 @@
333333
VerticalAlignment="Center"
334334
Background="Transparent"
335335
BorderBrush="Transparent"
336-
Focusable="False"
336+
Focusable="True"
337337
FontSize="14"
338338
FontWeight="Bold"
339+
KeyboardNavigation.TabNavigation="Cycle"
339340
Foreground="{DynamicResource CalendarViewForeground}" />
340341
<Button
341342
x:Name="PART_PreviousButton"
342-
Grid.Column="1"
343+
Grid.Column="1"
343344
Width="26"
344345
Height="26"
345346
Margin="0,0,8,0"
@@ -348,8 +349,9 @@
348349
VerticalAlignment="Center"
349350
Background="Transparent"
350351
BorderBrush="Transparent"
351-
Focusable="False"
352+
Focusable="True"
352353
AutomationProperties.Name="Previous"
354+
KeyboardNavigation.TabNavigation="Cycle"
353355
Foreground="{DynamicResource CalendarViewButtonForeground}">
354356
<Button.Content>
355357
<TextBlock
@@ -369,8 +371,9 @@
369371
VerticalAlignment="Center"
370372
Background="Transparent"
371373
BorderBrush="Transparent"
372-
Focusable="False"
374+
Focusable="True"
373375
AutomationProperties.Name="Next"
376+
KeyboardNavigation.TabNavigation="Contained"
374377
Foreground="{DynamicResource CalendarViewButtonForeground}">
375378
<Button.Content>
376379
<TextBlock
@@ -387,6 +390,7 @@
387390
Grid.Row="1"
388391
HorizontalAlignment="Center"
389392
VerticalAlignment="Center"
393+
KeyboardNavigation.TabNavigation="None"
390394
Visibility="Visible">
391395
<Grid.ColumnDefinitions>
392396
<ColumnDefinition Width="Auto" />
@@ -412,7 +416,7 @@
412416
Grid.Row="1"
413417
HorizontalAlignment="Center"
414418
VerticalAlignment="Center">
415-
<Grid x:Name="PART_YearView" Visibility="Hidden">
419+
<Grid x:Name="PART_YearView" Visibility="Hidden" KeyboardNavigation.TabNavigation="None">
416420
<Grid.ColumnDefinitions>
417421
<ColumnDefinition Width="Auto" />
418422
<ColumnDefinition Width="Auto" />

0 commit comments

Comments
 (0)