Add HeaderTemplate to DrawerPage header in themes by zdpcdt · Pull Request #21275 · AvaloniaUI/Avalonia (original) (raw)
What does the pull request do?
This pull request updates the DrawerPage.xaml templates in both the Fluent and Simple themes to improve how headers are displayed. The main change is replacing ContentControl with ContentPresenter for title presenters, and ensuring that any provided HeaderTemplate is correctly applied. This enhances template binding flexibility and supports custom header templates.
Improvements to header rendering and template flexibility:
- Replaced
ContentControlwithContentPresenterforPART_TitlePresenterandPART_BottomTitlePresenterinDrawerPage.xamlfor both Fluent and Simple themes, allowing for more accurate and flexible content presentation. [1] [2] [3] [4] - Added binding for
ContentTemplatetoHeaderTemplateon both presenters, enabling support for custom header templates via theHeaderTemplateproperty. [1] [2] [3] [4]
What is the current behavior?
What is the updated/expected behavior with this PR?
How was the solution implemented (if it's not obvious)?
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