[Windows] Fix titlebar not persisting when page is swapped#27192
Merged
[Windows] Fix titlebar not persisting when page is swapped#27192
Conversation
Fix titlebar leaking events when replaced
Contributor
There was a problem hiding this comment.
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();
PureWeen
requested changes
Jan 23, 2025
PureWeen
requested changes
Jan 23, 2025
Member
PureWeen
left a comment
There was a problem hiding this comment.
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
Member
Nevermind..... |
Remove unneeded TB removal Add leak test
PureWeen
requested changes
Jan 24, 2025
| } | ||
|
|
||
| SetToolbar(null); | ||
| SetTitleBar(null, null); |
Member
PureWeen
approved these changes
Jan 28, 2025
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.

Description of Change
Issues Fixed
Fixes #27170