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

[MAUI] 'Window.Title' couldn't be displayed after setting ‘Window.TitleBar' #27022

Open
Zhanglirong-Winnie opened this issue Jan 9, 2025 · 0 comments
Assignees
Labels
Milestone

Comments

@Zhanglirong-Winnie
Copy link

Zhanglirong-Winnie commented Jan 9, 2025

Description

Affected Build: 17.13.0 Preview 3.0 [35708.219.main]
Affected project:
https://microsoft-my.sharepoint.com/:u:/p/v-tianlz/EYHhIT_CE7JPvlYdzCBHjygBrWviXvWZ305RgE_s6eK84Q?e=3rEAtu

Steps to Reproduce

  1. Create .net MAUI project or Run the Sample Project
  2. Add the following code in MainPage.xaml:
    <Button
	     x:Name="CounterBtn2"
	     Text="Click me2" 
	     SemanticProperties.Hint="Counts the number of times you click"
	     Clicked="OnCounterClicked2"
	     HorizontalOptions="Fill" />
  1. Change the two Button events in MainPage.xaml.cs:
        private void OnCounterClicked(object sender, EventArgs e)
	 {
	     this.Window.TitleBar = null;
	     this.Window.Title = "Title";
	 }
	
	 private void OnCounterClicked2(object sender, EventArgs e)
	 {
	    this.Window.TitleBar = new TitleBar()
	    {
	        Title = "[TitleBar.TitleBar]",
	        Subtitle = "[Title.Subtitle]",
	        BackgroundColor = Color.FromRgb(255, 255, 0)
	    };
	 }
  1. Debugging on a Windows machine
  2. Click "Click Me"->Windows title displays "Title";
  3. Click "Click Me2"->Windows title displays "[TitleBar.TitleBar]";
  4. Click "Click Me" again to observe the Windows title display;

Actually:
Windows has no “Title” display.
Image

Expected:
The Windows "Title" displays normally.
Image

Link to public reproduction project repository

https://microsoft-my.sharepoint.com/:u:/p/v-tianlz/EYHhIT_CE7JPvlYdzCBHjygBrWviXvWZ305RgE_s6eK84Q?e=3rEAtu

Version with bug

Microsoft.Maui.Controls 9.0.30-ci.main.25058.3

Is this a regression from previous behavior?

Don't know. Previous versions were blocked by this issue(9.0.22 & 9.0.0).#26396

Affected platforms

Windows

@Zhanglirong-Winnie Zhanglirong-Winnie added csi-new platform/windows 🪟 s/triaged Issue has been reviewed t/bug Something isn't working labels Jan 9, 2025
@Zhanglirong-Winnie Zhanglirong-Winnie changed the title [MAUI] Windows "Title" display abnormally [MAUI] 'Window.Title' couldn't be displayed after setting ‘Window.TitleBar' Jan 9, 2025
@jfversluis jfversluis added this to the .NET 9 SR4 milestone Jan 9, 2025
@PureWeen PureWeen modified the milestones: .NET 9 SR4, .NET 9 SR3 Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

4 participants