Skip to content

Comments

Fix for Setting Window.TitleBar to null does not remove the customization #26568

Merged
PureWeen merged 5 commits intodotnet:mainfrom
BagavathiPerumal:fix-26396
Jan 6, 2025
Merged

Fix for Setting Window.TitleBar to null does not remove the customization #26568
PureWeen merged 5 commits intodotnet:mainfrom
BagavathiPerumal:fix-26396

Conversation

@BagavathiPerumal
Copy link
Contributor

@BagavathiPerumal BagavathiPerumal commented Dec 12, 2024

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.

  • Windows
  • Android
  • iOS
  • Mac

Currently, the TitleBar control is only available on the Windows platform.

Issues Fixed

Fixes #26396

Output

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

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Dec 12, 2024
@vishnumenon2684 vishnumenon2684 added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 12, 2024
@BagavathiPerumal BagavathiPerumal marked this pull request as ready for review December 12, 2024 12:28
@jfversluis jfversluis requested a review from Foda December 12, 2024 12:59
@jfversluis
Copy link
Member

jfversluis commented Dec 12, 2024

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen added this to the .NET 9 SR3 milestone Dec 16, 2024
Foda
Foda previously approved these changes Dec 16, 2024
PureWeen
PureWeen previously approved these changes Dec 25, 2024
@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

@PureWeen
Copy link
Member

@BagavathiPerumal can you fix merge conflict please

@BagavathiPerumal BagavathiPerumal dismissed stale reviews from PureWeen and Foda via 5a4efad December 30, 2024 06:18
@BagavathiPerumal
Copy link
Contributor Author

@BagavathiPerumal can you fix merge conflict please

@PureWeen, I have resolved the merge conflict.

@PureWeen
Copy link
Member

PureWeen commented Jan 5, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen merged commit 38d98f2 into dotnet:main Jan 6, 2025
104 checks passed
@PureWeen
Copy link
Member

PureWeen commented Jan 6, 2025

Manual test has been added for this scenario

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-titlebar community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Setting Window.TitleBar to null does not remove the customization

5 participants