Skip to content

Add lightweight styling resources for AppBarButton width - #11590

Closed
Niels Laute (niels9001) wants to merge 1 commit into
microsoft:mainfrom
niels9001:feature/9403-appbarbutton-width-resources
Closed

Add lightweight styling resources for AppBarButton width#11590
Niels Laute (niels9001) wants to merge 1 commit into
microsoft:mainfrom
niels9001:feature/9403-appbarbutton-width-resources

Conversation

@niels9001

Copy link
Copy Markdown
Collaborator

Fixes

Fixes #9403

PR Type

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Description

Current Behavior

The default 68px width of AppBarButton and AppBarToggleButton is fixed in their styles and cannot be changed through lightweight styling resources.

New Behavior

Adds AppBarButtonWidth and AppBarToggleButtonWidth resources, both defaulting to 68px in the regular and perf2026 styles. Overflow buttons remain auto-sized, and a locally set Width continues to take precedence. API and rendered-width coverage verify default, resource-overridden, overflow, and local-width behavior.

Customer Impact

Apps can adjust command button widths through lightweight styling without replacing the control templates.

Regression Potential

  • Low risk — isolated change, limited scope
  • Medium risk — touches shared components or public APIs
  • High risk — architectural or breaking API change

The new resources preserve the current defaults and precedence rules.

How Has This Been Tested?

  • I have performed a self-review of my own code
  • I have added tests to cover my changes
  • Existing tests pass locally

The product controls, core XAML, theme XBF, resource satellites, test app, and test project were previously built. The focused tests built and were discovered; execution was blocked by an activation failure also reproduced on the unchanged baseline.

Screenshots (if appropriate)

Not applicable.

Add overridable width resources for AppBarButton and AppBarToggleButton while preserving auto-sized overflow and local Width precedence.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8ab4ed7c-df52-4775-bc59-85ca7fbd5ec4
@niels9001
Niels Laute (niels9001) requested a review from a team as a code owner August 24, 2026 20:36
@microsoft-github-policy-service microsoft-github-policy-service Bot added the needs-triage Issue needs to be triaged by the area owners label Aug 24, 2026
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Width" Value="68" />
<Setter Property="Width" Value="{ThemeResource AppBarButtonWidth}" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AppBarButtonWidth isn't a theme resource. Should this be StaticResource ? Comparing to for instance AppBarButtonInnerBorderOverflowMargin above it, that's always referenced as a static resource. Same goes for the other changes.

@niels9001

Copy link
Copy Markdown
Collaborator Author

Superseded by #11622, which uses a branch owned by this repository. Please continue review there.

@niels9001
Niels Laute (niels9001) deleted the feature/9403-appbarbutton-width-resources branch August 25, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-triage Issue needs to be triaged by the area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Make DefaultAppBarButtonStyle.Width a resource or a property

2 participants