[Windows] - Fixed Window Title Not Shown When Reverting from TitleBar to Default State#27148
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
left a comment
There was a problem hiding this comment.
Could use the #27022 sample to create an UITest?
|
Azure Pipelines successfully started running 3 pipeline(s). |
@jsuarezruiz, Thank you for the suggestion! The possibility of creating a UI test was explored, but during local testing, it was observed that the full window UI, including the TitleBar, is not captured, which prevents effective validation of this scenario through a UI test. Additionally, adding a UnitTest was considered; however, since the WindowTitle updates value as expected without the fix, Therefore, test cases were not included for this specific issue. Similarly TitleBar-related changes in PR #26568 excluded UI tests due to these same technical constraints. CI local Image : |
|
Testing is for sure a PITA since we strip out the titlebar, so approving without test |
|

Issue Details
When transitioning between the TitleBar and the Window Title, the window title fails to display correctly.
RootCause
During transitions between the TitleBar and the default Window Title, the ContentTemplate becomes null because the TitleBar sets Content directly without a template. This prevents the default template from being reapplied when reverting to the default Window Title, causing the title to not display.
Description of Change
When clearing the TitleBar (title bar is null), the method now checks if the ContentTemplate is null and reapplies the default template if necessary, ensuring the Window Title is restored properly during state changes.
Issues Fixed
Fixes #27022
Tested the behaviour in the following platforms
Output
Before-Fix.1.mp4
After-Fix.1.mp4
Test Case
Unable to add a test case for this scenario because the CI does not capture the window with the title bar. Additionally, creating a unit test is not feasible since the Window Title property updates correctly, but the changes are not reflected in the view.