-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[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
base: main
Are you sure you want to change the base?
[Fluent] Adding RecognizesAccessKey=True in remaining Fluent control styles #10932
Conversation
There was a problem hiding this 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}" /> |
There was a problem hiding this comment.
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.
<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}" /> |
There was a problem hiding this comment.
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.
<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}" /> |
There was a problem hiding this comment.
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.
<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}" /> |
There was a problem hiding this comment.
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.
<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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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