Skip to content

[Fluent] Adding RecognizesAccessKey=True in remaining Fluent control styles #10932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dipeshmsft
Copy link
Member

@dipeshmsft dipeshmsft commented Jun 12, 2025

Fixes #10928

Description

Adds RecognizesAccessKey property to RepeatButton, ToggleButton and Expander controls.

Customer Impact

Customers using Access keys to navigate in the application will get the correct behavior.

Regression

No

Testing

Local app testing

Risk

Minimal

Microsoft Reviewers: Open in CodeFlow

@Copilot Copilot AI review requested due to automatic review settings June 12, 2025 09:58
@dipeshmsft dipeshmsft requested a review from a team as a code owner June 12, 2025 09:58
@dipeshmsft dipeshmsft requested a review from harshit7962 June 12, 2025 09:58
@dipeshmsft dipeshmsft added this to the 10.0.0 milestone Jun 12, 2025
@dotnet-policy-service dotnet-policy-service bot added the PR metadata: Label to tag PRs, to facilitate with triage label Jun 12, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request addresses issue #10928 by ensuring that controls correctly support access key behavior. The key changes are:

  • Adding RecognizesAccessKey="True" to RepeatButton and ToggleButton templates.
  • Updating styles in various themes (Fluent, Fluent.Light, Fluent.HC, and Fluent.Dark) and control-specific XAML files.
  • Altering the Expander control template, although its changes seem inconsistent with the stated goal.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Fluent.xaml Updates RepeatButton and ToggleButton templates; Expander template removes RecognizesAccessKey attribute.
Fluent.Light.xaml Similar updates for RepeatButton/ToggleButton; Expander template change removes the property.
Fluent.HC.xaml Adds RecognizesAccessKey for some controls while removing it for Expander.
Fluent.Dark.xaml Consistent additions for RepeatButton/ToggleButton but removal for Expander controls.
ToggleButton.xaml, RepeatButton.xaml, Expander.xaml Standalone style files add the property for ToggleButton/RepeatButton; Expander style removals noted.
Comments suppressed due to low confidence (1)

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Expander.xaml:337

  • This change removes the RecognizesAccessKey attribute from the Expander style, which is unexpected given the PR description. Please update the Expander style to include RecognizesAccessKey="True".
<ContentPresenter x:Name="ContentPresenter"

@@ -2109,7 +2109,7 @@
<!-- Dummy border to store Animation factor for expander -->
<Border x:Name="AnimationFactorBorder" Width="0" Visibility="Collapsed" />
<Border x:Name="ContentPresenterBorder" Background="{DynamicResource ExpanderContentBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,0,1,1" CornerRadius="0,0,4,4" Visibility="Collapsed">
<ContentPresenter x:Name="ContentPresenter" RecognizesAccessKey="True" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
Copy link
Preview

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RecognizesAccessKey attribute is removed from the Expander ContentPresenter here, which conflicts with the PR description stating it should be added. Consider re-adding RecognizesAccessKey="True" for consistency across controls.

Suggested change
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" RecognizesAccessKey="True" />

Copilot uses AI. Check for mistakes.

@@ -2926,7 +2926,7 @@
<!-- Dummy border to store Animation factor for expander -->
<Border x:Name="AnimationFactorBorder" Width="0" Visibility="Collapsed" />
<Border x:Name="ContentPresenterBorder" Background="{DynamicResource ExpanderContentBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,0,1,1" CornerRadius="0,0,4,4" Visibility="Collapsed">
<ContentPresenter x:Name="ContentPresenter" RecognizesAccessKey="True" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
Copy link
Preview

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RecognizesAccessKey attribute has been removed from the Expander ContentPresenter, which appears inconsistent with the intended update. Please confirm if the property should be added instead.

Suggested change
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" RecognizesAccessKey="True" />

Copilot uses AI. Check for mistakes.

@@ -2811,7 +2811,7 @@
<!-- Dummy border to store Animation factor for expander -->
<Border x:Name="AnimationFactorBorder" Width="0" Visibility="Collapsed" />
<Border x:Name="ContentPresenterBorder" Background="{DynamicResource ExpanderContentBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,0,1,1" CornerRadius="0,0,4,4" Visibility="Collapsed">
<ContentPresenter x:Name="ContentPresenter" RecognizesAccessKey="True" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
Copy link
Preview

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the other themes, the RecognizesAccessKey property is removed from the Expander template. Re-add RecognizesAccessKey="True" to match the PR requirements.

Suggested change
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" RecognizesAccessKey="True" />

Copilot uses AI. Check for mistakes.

@@ -2911,7 +2911,7 @@
<!-- Dummy border to store Animation factor for expander -->
<Border x:Name="AnimationFactorBorder" Width="0" Visibility="Collapsed" />
<Border x:Name="ContentPresenterBorder" Background="{DynamicResource ExpanderContentBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,0,1,1" CornerRadius="0,0,4,4" Visibility="Collapsed">
<ContentPresenter x:Name="ContentPresenter" RecognizesAccessKey="True" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
Copy link
Preview

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of RecognizesAccessKey in the Expander ContentPresenter here deviates from the PR’s goal; consider adding it back for consistency.

Suggested change
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" />
<ContentPresenter x:Name="ContentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" RecognizesAccessKey="True" />

Copilot uses AI. Check for mistakes.

Copy link

codecov bot commented Jun 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 2.98754%. Comparing base (b4d57bf) to head (0c4dacd).

Additional details and impacted files
@@             Coverage Diff             @@
##               main     #10932   +/-   ##
===========================================
  Coverage   2.98754%   2.98754%           
===========================================
  Files          3319       3319           
  Lines        664894     664894           
  Branches      74674      74674           
===========================================
  Hits          19864      19864           
  Misses       644849     644849           
  Partials        181        181           
Flag Coverage Δ
Debug 2.98754% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR metadata: Label to tag PRs, to facilitate with triage Win 11 Theming
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[Fluent] Controls missing RecognizesAccessKey
2 participants