Extend TabView in title bar in WinUI 3
See original GitHub issueI’m trying to to show TabView tabs in the title bar in WinUI 3. This could be done quite easily in UWP, but obviously some of these APIs are not available in WinUI.
So I tried:
this.ExtendsContentIntoTitleBar = true;
tabViewFooter.MinWidth = 100;
this.SetTitleBar(tabViewFooter);
where “this” refers to main Window, but it doesn’t work properly. The window can be dragged and maximized / restored by double clicking but Minimize, Maximize and Close buttons don’t appear and the area where they should be is unresponsive to mouse events.
If it worked, it wouldn’t be 100% correct anyway because, unlike the UWP sample, it uses a fixed width and doesn’t consider RTL layouts.
Am I missing something?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Custom Title bar showing up white-ish in WinUI 3
How do you extend the title? Via Window, or via AppWindow? – Nick · I use ExtendsContentIntoTitleBar = true; and SetTitleBar(CustomDragRegion). – ...
Read more >Title bar customization - Windows apps
This article shows how to customize the title bar for apps that use either the Windows App SDK, WinUI 3, or UWP with...
Read more >Tab View - Windows apps
Display TabView tabs in a window's titlebar Instead of having tabs occupy their own row below a Window's titlebar, you can merge the...
Read more >Displaying DataGrid Row Details in a TabView in WinUI 3
Our sample app contains a reusable window that comes with an empty TabView. It overlaps the title bar, like most browser windows.
Read more >Building Windows Terminal with WinUI
It has proven to be fairly difficult to get our UI into the title bar area. While Terminal now does iconically have its...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you refer to the docs on custom titlebar, we recommend using simple UI elements like stackpanel or grid for custom titlebar element. Complex elements create ui layout issues. Also, any uielement set as custom titlebar cannot receive input because all the input is taken for titlebar operations like drag.
https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.window.settitlebar?view=winui-3.0
I am closing this issue. If you got follow up question, feel free to re-open it.
You can try this code (please check your winui version >= 1.0.0 experimental
create helper class
using AppWindow.TitleBar.ExtendsContentToTitleBar