|
17 | 17 | </ResourceDictionary> |
18 | 18 | </ResourceDictionary.MergedDictionaries> |
19 | 19 |
|
| 20 | + <Style x:Key="EllipticalFocusStyle" BasedOn="{StaticResource {x:Static SystemParameters.FocusVisualStyleKey}}"> |
| 21 | + <Setter Property="Control.Template"> |
| 22 | + <Setter.Value> |
| 23 | + <ControlTemplate> |
| 24 | + <Grid> |
| 25 | + <Grid.Width> |
| 26 | + <MultiBinding Converter="{StaticResource RoundMathConverter}"> |
| 27 | + <Binding Path="ActualWidth" RelativeSource="{RelativeSource TemplatedParent}" /> |
| 28 | + <Binding Path="ActualHeight" RelativeSource="{RelativeSource TemplatedParent}" /> |
| 29 | + </MultiBinding> |
| 30 | + </Grid.Width> |
| 31 | + <Grid.Height> |
| 32 | + <MultiBinding Converter="{StaticResource RoundMathConverter}"> |
| 33 | + <Binding Path="ActualWidth" RelativeSource="{RelativeSource TemplatedParent}" /> |
| 34 | + <Binding Path="ActualHeight" RelativeSource="{RelativeSource TemplatedParent}" /> |
| 35 | + </MultiBinding> |
| 36 | + </Grid.Height> |
| 37 | + <Ellipse Stroke="{TemplateBinding chelper:FocusVisualHelper.FocusVisualSecondaryBrush}" |
| 38 | + StrokeThickness="1" /> |
| 39 | + <Ellipse Stroke="{TemplateBinding chelper:FocusVisualHelper.FocusVisualPrimaryBrush}" |
| 40 | + StrokeThickness="2" /> |
| 41 | + </Grid> |
| 42 | + </ControlTemplate> |
| 43 | + </Setter.Value> |
| 44 | + </Setter> |
| 45 | + </Style> |
| 46 | + |
20 | 47 | <Style x:Key="DefaultCalendarItemStyle" TargetType="CalendarItem"> |
21 | 48 | <Setter Property="OverridesDefaultStyle" Value="True" /> |
22 | 49 | <Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|
38 | 65 | <TextBlock Style="{StaticResource WeekDayNameStyle}" Text="{Binding}" /> |
39 | 66 | </DataTemplate> |
40 | 67 | </ControlTemplate.Resources> |
41 | | - <Grid x:Name="PART_Root" SnapsToDevicePixels="True"> |
| 68 | + <Grid x:Name="PART_Root" SnapsToDevicePixels="True" KeyboardNavigation.TabNavigation="Local"> |
42 | 69 | <Grid.Resources> |
43 | 70 | <Style |
44 | 71 | x:Key="HeaderNavigationButtonStyle" |
|
168 | 195 | <ColumnDefinition Width="Auto" /> |
169 | 196 | </Grid.ColumnDefinitions> |
170 | 197 | <Button |
| 198 | + KeyboardNavigation.TabIndex="0" |
171 | 199 | x:Name="PART_HeaderButton" |
172 | 200 | HorizontalContentAlignment="Left" |
173 | | - Focusable="False" |
174 | 201 | Style="{StaticResource HeaderNavigationButtonStyle}" /> |
175 | 202 | <Button |
176 | 203 | x:Name="PART_PreviousButton" |
| 204 | + KeyboardNavigation.TabIndex="1" |
177 | 205 | Grid.Column="1" |
178 | 206 | Margin="{DynamicResource CalendarViewNavigationPreviousButtonMargin}" |
179 | 207 | HorizontalContentAlignment="Center" |
180 | 208 | Content="" |
181 | | - Focusable="False" |
182 | 209 | Style="{StaticResource NavigationButtonStyle}" /> |
183 | 210 | <Button |
184 | 211 | x:Name="PART_NextButton" |
| 212 | + KeyboardNavigation.TabIndex="2" |
185 | 213 | Grid.Column="2" |
186 | 214 | Margin="{DynamicResource CalendarViewNavigationNextButtonMargin}" |
187 | 215 | HorizontalContentAlignment="Center" |
188 | 216 | Content="" |
189 | | - Focusable="False" |
190 | 217 | Style="{StaticResource NavigationButtonStyle}" /> |
191 | 218 | </Grid> |
192 | 219 | <Border |
|
207 | 234 | x:Name="PART_MonthView" |
208 | 235 | RenderTransformOrigin="0.5,0.5" |
209 | 236 | TextElement.Foreground="{DynamicResource CalendarViewCalendarItemForeground}" |
210 | | - Visibility="Visible"> |
| 237 | + Visibility="Visible" |
| 238 | + KeyboardNavigation.TabNavigation="Once" |
| 239 | + KeyboardNavigation.TabIndex="3" |
| 240 | + Margin="3,0"> |
211 | 241 | <Grid.ColumnDefinitions> |
212 | 242 | <ColumnDefinition Width="*" /> |
213 | 243 | <ColumnDefinition Width="*" /> |
|
233 | 263 | <Grid |
234 | 264 | x:Name="PART_YearView" |
235 | 265 | RenderTransformOrigin="0.5,0.5" |
236 | | - Visibility="Hidden"> |
| 266 | + Visibility="Collapsed" |
| 267 | + KeyboardNavigation.TabNavigation="Once" |
| 268 | + KeyboardNavigation.TabIndex="3"> |
237 | 269 | <Grid.ColumnDefinitions> |
238 | 270 | <ColumnDefinition Width="*" /> |
239 | 271 | <ColumnDefinition Width="*" /> |
|
273 | 305 | <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MonthView" Storyboard.TargetProperty="IsEnabled"> |
274 | 306 | <DiscreteBooleanKeyFrame KeyTime="0:0:0" Value="False" /> |
275 | 307 | </BooleanAnimationUsingKeyFrames> |
| 308 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_MonthView" Storyboard.TargetProperty="Visibility"> |
| 309 | + <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Hidden}" /> |
| 310 | + </ObjectAnimationUsingKeyFrames> |
276 | 311 | <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_MonthView" Storyboard.TargetProperty="Opacity"> |
277 | 312 | <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0" /> |
278 | 313 | </DoubleAnimationUsingKeyFrames> |
|
293 | 328 | KeyTime="0:0:0.150" |
294 | 329 | Value="0" /> |
295 | 330 | </DoubleAnimationUsingKeyFrames> |
| 331 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_MonthView" Storyboard.TargetProperty="Visibility"> |
| 332 | + <DiscreteObjectKeyFrame KeyTime="0:0:0.150" Value="{x:Static Visibility.Hidden}" /> |
| 333 | + </ObjectAnimationUsingKeyFrames> |
296 | 334 | <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_YearView" Storyboard.TargetProperty="Opacity"> |
297 | 335 | <DiscreteDoubleKeyFrame KeyTime="0" Value="0" /> |
298 | 336 | <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0" /> |
|
348 | 386 | <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_YearView" Storyboard.TargetProperty="IsHitTestVisible"> |
349 | 387 | <DiscreteBooleanKeyFrame KeyTime="0" Value="False" /> |
350 | 388 | </BooleanAnimationUsingKeyFrames> |
351 | | - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_YearView" Storyboard.TargetProperty="Visibility"> |
| 389 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_MonthView" Storyboard.TargetProperty="Visibility"> |
352 | 390 | <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Visible}" /> |
353 | 391 | </ObjectAnimationUsingKeyFrames> |
354 | 392 | <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_YearView" Storyboard.TargetProperty="Opacity"> |
|
588 | 626 | <Setter Property="FontSize" Value="{DynamicResource CalendarViewDayItemFontSize}" /> |
589 | 627 | <Setter Property="HorizontalContentAlignment" Value="Center" /> |
590 | 628 | <Setter Property="VerticalContentAlignment" Value="Center" /> |
591 | | - <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" /> |
| 629 | + <Setter Property="FocusVisualStyle" Value="{StaticResource EllipticalFocusStyle}"/> |
592 | 630 | <Setter Property="chelper:FocusVisualHelper.UseSystemFocusVisuals" Value="True" /> |
593 | | - <Setter Property="chelper:FocusVisualHelper.FocusVisualMargin" Value="-2" /> |
| 631 | + <Setter Property="chelper:FocusVisualHelper.FocusVisualMargin" Value="-3" /> |
594 | 632 | <Setter Property="Template"> |
595 | 633 | <Setter.Value> |
596 | 634 | <ControlTemplate TargetType="CalendarDayButton"> |
|
767 | 805 | <Setter Property="FontWeight" Value="Normal" /> |
768 | 806 | <Setter Property="HorizontalContentAlignment" Value="Center" /> |
769 | 807 | <Setter Property="VerticalContentAlignment" Value="Center" /> |
770 | | - <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" /> |
| 808 | + <Setter Property="FocusVisualStyle" Value="{StaticResource EllipticalFocusStyle}"/> |
771 | 809 | <Setter Property="chelper:FocusVisualHelper.UseSystemFocusVisuals" Value="True" /> |
772 | | - <Setter Property="chelper:FocusVisualHelper.FocusVisualMargin" Value="-2" /> |
| 810 | + <Setter Property="chelper:FocusVisualHelper.FocusVisualMargin" Value="-4,-3.5,-3.5,-3" /> |
773 | 811 | <Setter Property="Template"> |
774 | 812 | <Setter.Value> |
775 | 813 | <ControlTemplate TargetType="CalendarButton"> |
|
0 commit comments