Fix for Setting Window.TitleBar to null does not remove the customization #26568
Merged
PureWeen merged 5 commits intodotnet:mainfrom Jan 6, 2025
Merged
Fix for Setting Window.TitleBar to null does not remove the customization #26568PureWeen merged 5 commits intodotnet:mainfrom
PureWeen merged 5 commits intodotnet:mainfrom
Conversation
…vious TitleBar content from the visual tree.
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Foda
previously approved these changes
Dec 16, 2024
PureWeen
previously approved these changes
Dec 25, 2024
Member
|
/azp run |
|
Pull request contains merge conflicts. |
Member
|
@BagavathiPerumal can you fix merge conflict please |
…fix-26396 # Conflicts: # src/Core/src/Platform/Windows/WindowRootView.cs
Contributor
Author
@PureWeen, I have resolved the merge conflict. |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
PureWeen
approved these changes
Jan 6, 2025
Member
|
Manual test has been added for this scenario |
Merged
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
The issue occurs because the AppTitleBarContentControl, which holds the custom TitleBar content for the application, is not cleared properly when switching pages. When the Window.TitleBar is set to null, the AppTitleBarContentControl.Content should be reset to remove the previous TitleBar content. However, this reset is not happening, so the custom TitleBar from the previous page stays visible, causing inconsistencies in the TitleBar appearance when navigating to new pages.
Description of Issue Fix
The fix involves setting the Content property of AppTitleBarContentControl to null to ensure that the TitleBar content is removed from the visual tree.
Tested the behavior in the following platforms.
Currently, the TitleBar control is only available on the Windows platform.
Issues Fixed
Fixes #26396
Output
BeforeFix-26396.mp4
AfterFix-26396.mp4
Testcase
We are unable to add a test case for this scenario because the CI does not capture the window with the title bar. We also can't create a unit test since the TitleBar property can't be compared. The property updates correctly, but the view doesn't reflect the changes.