Rename AppBar controls by jsuarezruiz · Pull Request #21041 · AvaloniaUI/Avalonia (original) (raw)
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:
CommandBarButtonCommandBarToggleButtonCommandBarSeparator
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:
- CommandBar-related Controls Should Not Use AppBar Prefix #21014
- AppBarSeparator / CommandBarSeparator should Derive from Separator #21015
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:
CommandBarButtonCommandBarToggleButtonCommandBarSeparator
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*toCommandBar* - Updated
CommandBarinternals 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
CommandBarSeparatorto inherit fromSeparator - Added/updated tests to cover the renamed API and the new separator inheritance
Checklist
- Added unit tests (if possible)?
- Added XML documentation to any related classes?
- Consider submitting a PR to https://github.com/AvaloniaUI/avalonia-docs with user documentation
Breaking changes
This PR contains source-breaking API changes:
AppBarButtonwas renamed toCommandBarButtonAppBarToggleButtonwas renamed toCommandBarToggleButtonAppBarSeparatorwas renamed toCommandBarSeparator
Obsoletions / Deprecations
None.
