-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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] Fix titlebar not persisting when page is swapped #27192
Conversation
Fix titlebar leaking events when replaced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.
Files not reviewed (2)
- src/Core/src/Platform/Windows/NavigationRootManager.cs: Evaluated as low risk
- src/Core/src/Platform/Windows/WindowRootView.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)
src/Controls/src/Core/Window/Window.cs:395
- Ensure that there are test cases covering the cleanup and reattachment of the title bar when the page is swapped.
prevTitleBar.Cleanup();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Playing with this it seems like the TitleBar still disappears?
tested in the sandbox
return new Window(new NavigationPage(new MainPage()))
{
TitleBar = new TitleBar
{
BackgroundColor = Colors.Red,
ForegroundColor = Colors.White,
Subtitle = "Subtitle",
}
};
Then in MainPage I swapped out the Page on Window
<VerticalStackLayout>
<Button Text="me" Clicked="Button_Clicked"></Button>
</VerticalStackLayout>
private void Button_Clicked(object sender, EventArgs e)
{
this.Window.Page = new MainPage();
}
The TitleBar seems to reset when the page is swapped
Nevermind..... |
Remove unneeded TB removal Add leak test
@@ -120,7 +146,6 @@ public virtual void Disconnect() | |||
} | |||
|
|||
SetToolbar(null); | |||
SetTitleBar(null, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description of Change
Issues Fixed
Fixes #27170