Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] - Fixed Window Title Not Shown When Reverting from TitleBar to Default State #27148

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

prakashKannanSf3972
Copy link
Contributor

@prakashKannanSf3972 prakashKannanSf3972 commented Jan 15, 2025

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

  • Windows
  • Android
  • iOS
  • Mac

Output

Before After
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.

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jan 15, 2025
@vishnumenon2684 vishnumenon2684 added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 15, 2025
@prakashKannanSf3972 prakashKannanSf3972 marked this pull request as ready for review January 16, 2025 03:39
@prakashKannanSf3972 prakashKannanSf3972 requested a review from a team as a code owner January 16, 2025 03:39
@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Jan 16, 2025

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Could use the #27022 sample to create an UITest?

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@prakashKannanSf3972
Copy link
Contributor Author

Could use the #27022 sample to create an UITest?

@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 :

UpdatedWindowTitle

@PureWeen PureWeen added this to the .NET 9 SR4 milestone Jan 28, 2025
@Foda
Copy link
Member

Foda commented Jan 29, 2025

Testing is for sure a PITA since we strip out the titlebar, so approving without test

@PureWeen
Copy link
Member

  • failing test is unrelated
  • CSI is going to add a manual test that covers this scenario

@PureWeen PureWeen merged commit 228f05f into dotnet:main Jan 29, 2025
102 of 104 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[MAUI] 'Window.Title' couldn't be displayed after setting ‘Window.TitleBar'
5 participants