11

Is there a way to somehow hide / collapse / make temporarily invisible (but not fully disable) titlebar in a UWP app?

I know that it is possible to make app fullscreen after which title bar automatically collapses, but I need to implement it in a resizable desktop window. I also know that you can customize appearance of titlebar, like color, etc.

Reason: I have an application with a lot of windows and need to save screen space and have more room for client area of windows.

I've read different sources, but couldn't find an answer:

For example, there seems to be a solution for the same problem for WPF: How to remove the title bar from a window but keep the border

Community
  • 1
  • 1
Bad
  • 4,967
  • 4
  • 34
  • 50
  • There isn't and I guess that's for good reasons ;) – sibbl Oct 30 '15 at 16:32
  • What good reasons could there be? In fact, title bar is already collapsable in fullscreen mode. Why not make it also collapsable in the same way in "resizable window" mode? – Bad Oct 30 '15 at 17:21
  • If it was collapsed how could it be uncollapsed? A good reason could always be it's a little used/requested feature and so didn't make it on the priority list. – Matt Lacey Nov 01 '15 at 04:09
  • 1
    @Matt Lacey: It could be, for example, uncollapsed when hover over the upper right corner of the window (while still keeping the ability to move window by dragging it like it is already done in `ExtendViewIntoTitleBar = true` mode), or there could be small thick line (or any other small convenient control) at the border of the window which would uncollapse titlebar when clicked. – Bad Nov 03 '15 at 16:55

1 Answers1

31

Finally, I should say, that, for the purposes of having additional screen real estate (which I needed), it is possible to expand client area to title bar and make background color of 3 buttons (minimize, maximize, close) transparent:

With standard titlebar:

enter image description here

With extended view and transparent buttons' background:

ApplicationViewTitleBar formattableTitleBar = ApplicationView.GetForCurrentView().TitleBar;
formattableTitleBar.ButtonBackgroundColor = Colors.Transparent;
CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
coreTitleBar.ExtendViewIntoTitleBar = true;

enter image description here

Bad
  • 4,967
  • 4
  • 34
  • 50
  • I placed the code in the OnLoaded method and it works. Is there a better place for it? – dwaz Sep 24 '21 at 12:35
  • If you have a dark background like the answer, make sure to add this to change the button color so it is easier to see than the image above... `formattableTitleBar.ButtonForegroundColor = Colors.White;` – scottpetrovic Sep 29 '22 at 17:44