maui icon indicating copy to clipboard operation
maui copied to clipboard

Propagate any Page.Title to the window, not just for Shell

Open jfversluis opened this issue 1 year ago • 4 comments

Description of Change

Trying to fix the empty title bar in Blazor Hybrid templates by updating the Title property in the Window.cs file. I don't think there is any reason to cast it specifically to Shell as each Page could have a title.

Verified this change works! 👇

image

Issues Fixed

Fixes #25337

jfversluis avatar Oct 17 '24 07:10 jfversluis

@PureWeen OK so why do we do it for Shell and not the rest? Because Shell is just the singular thing that people will have?

You can still set the Window one and that will take precedence?

Just thinking about the File > New experience I guess, now we need one other place where I need to scrub the default template values to make the title show up nicely?

I don't have a strong opinion either way. @Eilon?

jfversluis avatar Oct 17 '24 18:10 jfversluis

@PureWeen OK so why do we do it for Shell and not the rest? Because Shell is just the singular thing that people will have?

You can still set the Window one and that will take precedence?

Just thinking about the File > New experience I guess, now we need one other place where I need to scrub the default template values to make the title show up nicely?

I don't have a strong opinion either way. @Eilon?

Shell == Window

It's your entire window context

Shell basically represented Window in XF before we had the concept of a Window.

If we want Blazor to have a Window title it should go here https://github.com/dotnet/maui/blob/net9.0/src/Templates/src/templates/maui-blazor/App.xaml.cs#L10-L13

PureWeen avatar Oct 18 '24 17:10 PureWeen

So like this? https://github.com/dotnet/maui/pull/25387

Eilon avatar Oct 18 '24 17:10 Eilon

@PureWeen / @jfversluis - so I guess we can close this if it's considered just a legacy behavior?

Eilon avatar Oct 21 '24 18:10 Eilon