Skip to content

Rename AppBar controls#21041

Merged
MrJul merged 4 commits into
AvaloniaUI:masterfrom
jsuarezruiz:fix-21014
Mar 30, 2026
Merged

Rename AppBar controls#21041
MrJul merged 4 commits into
AvaloniaUI:masterfrom
jsuarezruiz:fix-21014

Conversation

@jsuarezruiz

@jsuarezruiz jsuarezruiz commented Mar 30, 2026

Copy link
Copy Markdown
Member

What does the pull request do?

This PR rename the newly introduced CommandBar companion control API before 12.0 final.

It renames the public AppBarButton, AppBarToggleButton, and AppBarSeparator types to:

  • CommandBarButton
  • CommandBarToggleButton
  • CommandBarSeparator
image

It also updates the related CommandBar logic, themes, tests, and ControlCatalog samples to use the new names consistently.

In addition, it addresses CommandBarSeparator API shape by making it derive from Separator.

Related issues:

What is the current behavior?

The CommandBar control uses child controls that are still publicly named AppBar*, which is inconsistent and confusing.

Also, CommandBarSeparator currently derives directly from TemplatedControl instead of Separator, even though it conceptually represents a separator.

What is the updated/expected behavior with this PR?

The public API is now aligned with the CommandBar naming:

  • CommandBarButton
  • CommandBarToggleButton
  • CommandBarSeparator

CommandBarSeparator now derives from Separator.

How was the solution implemented (if it's not obvious)?

This is a direct rename, without obsolete compatibility wrappers, based on the discussion in #21014.

Implementation details:

  • Renamed the public control types and source files from AppBar* to CommandBar*
  • Updated CommandBar internals to use the renamed types
  • Updated Fluent and Simple themes to target the renamed controls
  • Updated NavigationPage styling/selectors
  • Updated unit tests, render tests, and ControlCatalog samples
  • Changed CommandBarSeparator to inherit from Separator
  • Added/updated tests to cover the renamed API and the new separator inheritance

Checklist

Breaking changes

This PR contains source-breaking API changes:

  • AppBarButton was renamed to CommandBarButton
  • AppBarToggleButton was renamed to CommandBarToggleButton
  • AppBarSeparator was renamed to CommandBarSeparator

Obsoletions / Deprecations

None.

Fixed issues

Fixes #21014
Fixes #21015

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.0.999-cibuild0064265-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@MrJul MrJul added this pull request to the merge queue Mar 30, 2026
Merged via the queue into AvaloniaUI:master with commit 94c809f Mar 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AppBarSeparator / CommandBarSeparator should Derive from Separator CommandBar-related Controls Should Not Use AppBar Prefix

3 participants