Blazor Hybrid templates have an empty title bar
The default Blazor Hybrid templates have an empty window title bar. The regular .NET MAUI templates have the app's name in the title bar.
| Blazor Hybrid, even if I set the ContentPage's Title | .NET MAUI |
|---|---|
| Taskbar (no title) | Taskbar (has title) |
I'm not sure the right way to fix this. It seems that the Shell control picks up the title and makes it the app window's title. But without Shell I'm not sure how to do it.
Looks like its this: https://github.com/dotnet/maui/blob/f86bf4771a828a41358818f10f9498870acd5524/src/Controls/src/Core/Window/Window.cs#L110
We only cast it to Shell and take that title, but don't do it for any other page type?
The other thing we could to is set the title in the App.xaml.cs when we create a new window but I don't think that's a great solution as you'll have another separate place where you need to set a title.
~Added a potential fix here: #25338 lets try the resulting binaries and see if that has the desired effect.~ Also cc: @PureWeen
Verified this works, see PR.
The default Blazor Hybrid templates have an empty window title bar. The regular .NET MAUI templates have the app's name in the title bar.
Blazor Hybrid, even if I set the ContentPage's Title .NET MAUI
![]()
Taskbar (no title) Taskbar (has title)
![]()
I'm not sure the right way to fix this. It seems that the Shell control picks up the title and makes it the app window's title. But without Shell I'm not sure how to do it.
All shell does it set it on the Window
The guidance here for users has been to just set it on the Window itself
every element in the hierarchy has access to the window so it can set it that way.
Now that we make people override CreateWindow you can set it there
https://github.com/dotnet/maui/pull/25338#issuecomment-2422908977
Hi @Eilon. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
See new attempt here: https://github.com/dotnet/maui/pull/25387
9.0.1xx PR: #25426
Fixed by #25426