Description
Summary
I'm looking at the new TitleBar, and while functionally and visually I LOVE it, I have some concerns about the API itself.
First of all, the naming of Header
and Footer
is very misleading. Those names typically refer to top/bottom items, and the entire control in-of-itself is a header control. I looked at those properties and couldn't at all guess what they really were for, until I saw this image:
Generally I'd prefer naming that allows you do an informed guess what they do, and in the community call several people were confused about this.
So these are left/right, and I'm not actually sure if Header is before or after those buttons (illustration doesn't make that clear). Header
also clashes with the Title
here, adding extra confusion.
My second (albeit slightly lesser) concern is the use of Pane and Back buttons. It's extremely opinionated, and I worry we're gonna get too many apps looking too identical. I'd rather this was a Button collection of sorts instead, where I could choose to add some buttons, or choose to just put them in the "Headers" content (pending a better name). If I needed a 3rd button there I'm out of luck.
Then there's the TitlebarTemplateSettings
class:
I find this a bit weird. When I think template, I think control templates, but this appears to just be a way to set the app icon - why not just set the icon on the TitleBar directly? But more importantly I think that this should be a Window property (not AppWindow, but Window Window!) that also applies if I don't use the TitleBar.
Another approach is perhaps providing a MUCH simpler titlebar control that just takes care of allowing you to interact with buttons and textboxes etc, while still being able to drag the rest, but you own the entire content as a single content item. Then you add a secondary subclass of that titlebar that adds this more opionated version to cover some common scenarios.
Activity
lolametro commentedon Jun 5, 2024
They probably wanted to avoid
Left
/Right
due to RTL languages. Usually it would then be calledBegin
andEnd
.riverar commentedon Jun 5, 2024
Agree with the commentary above. To add:
Header
andFooter
are very confusing. One proposal is to align with Microsoft Fluent components, which use[Content]Before
and[Content]After
(https://react.fluentui.dev/?path=/docs/components-input--default#content-before-after). This terminology is also suitable for right-to-left languages.It's also confusing this isn't just part of
Window
, so that things like setting the icon are naturally wired up toWM_SETICON
.dotMorten commentedon Jun 5, 2024
Yeah being able to write
would have been way more intuitive, but unfortunately the baseclass of Window is wrong and prevents this.
MikeHillberg commentedon Jun 5, 2024
That property element syntax is OK on Window; that's a general Xaml language syntax and not specific to DO. E.g. you can do
dotMorten commentedon Jun 5, 2024
@MikeHillberg Yes but now you can't evaluate binding context. The thing falls apart a soon as you want to bind etc:
Not to mention your example above didn't even work until very recently and had to be set in code-behind ;D
mdtauk commentedon Jun 5, 2024
What would be the best practice to use this TitleBar control, along with a TabView control, where the tabs are not a drag region, but the bar where the tabs are contained, is draggable?
Titlebar's Tall mode would fit well with the TabView, but can you collapse the Header, Icon, Title, Subtitle parts, so content takes up more space?
moshegutman commentedon Jun 5, 2024
Leading/Trailing instead of Header/Footer would work for RTL too.
That's what Apple does: https://developer.apple.com/documentation/swiftui/toolbaritemplacement/topbarleading
BreeceW commentedon Jun 5, 2024
I agree that the pane button is too opinionated and having a button collection instead would be good, but the back button makes sense as a dedicated option. Uniformity there is good and provides a direct alternative to the old CoreWindow back button from UWP. The back button also has a different style that makes sense only for the back button (goes all the way to the edges, like caption buttons), so it’s good that it’s distinct.
roxk commentedon Jun 6, 2024
It being opinionated is a good thing. Windows has been blamed for its inconsistency for a long time and enforcing some kind of consistency is good here. Devs who wish to have custom button collections could always implement their own. I find it wise to leave the official default to represent "what we want devs to do". That's the point of the title bar control - to make apps look the same according to the fluent guideline.
(In fact, you can argue navigation view etc also suffer from this "all apps look the same" problem, but again this is a good thing to have uniformity/consistency. The biggest benefit of consistency is users familiarity)
AndrewKeepCoding commentedon Jun 6, 2024
At least, it's consistent with the

NavigationView
'sTopPane
.dotMorten commentedon Jun 6, 2024
I'd argue that's just as confusing. I can see the consistency argument to some extent, but we could also break with it before it becomes a pattern.
AndrewKeepCoding commentedon Jun 6, 2024
I see. It's still in experimental preview. Everything is possible. Then I hope it gets simpler as you suggest in your comment above.
dotMorten commentedon Jun 6, 2024
Yeah hopefully the design isn't settled yet. I assume the experimental previews are here for not just bug testing, but also so we have a chance to give feedback on the overall features, hence this issue.
35 remaining items