Hi @123244 ,
My name is Harry, Support Engineer who specialize in UWP (Universal Windows Platform). Thank you for reaching out on Microsoft Q&A! Let me help clarify what’s happening in your scenario and why you’re seeing this behavior.
In UWP, the Popup
control is designed to render in a dedicated visual layer above the main content of your app. This ensures that the popup captures focus and interaction until it’s closed. Because your custom title bar (AppTitleBar
) is defined inside the main page layout, it sits underneath this overlay layer. So when the popup opened, it's totally normal if you cannot click or drag your title bar until the popup is closed.
If your requirement is to allow interaction with both at the same time, you would need to use a separate window rather than a popup. You can learn more about creating additional windows here: Create and display multiple views.
Regarding your second approach using:
Window.Current.SetTitleBar(new ApplicationTitleBar());
This works differently because the element you pass to SetTitleBar
is not inserted into your page’s visual tree. Instead, it is registered directly with the windowing system as the drag region for the entire app window. This bypasses normal hit-testing rules in the XAML layer, so even if another UI element (like your popup) is visually on top of that area, the OS still recognizes it as a draggable region.
It’s important to note that SetTitleBar
does not create a new titlebar
, it just forces an element acts as titlebar
. It also have to be given an element that looks like a title bar. It can be any UIElement
— a rectangle, a button, or even part of your main content — and the OS will treat that area as the draggable zone for the entire window. In your case, you’ve chosen to pass a title bar element, so the behavior matches a traditional window title bar. For example:
- You could pass a
Grid
at the bottom of the window, making the window draggable from the bottom edge. - You could pass an invisible rectangle in the middle of your content to allow dragging from that spot.
- You could combine a visible title bar with other draggable regions elsewhere in your UI.
I hope this clarifies why your XAML-defined title bar is blocked by the popup and why the SetTitleBar
approach works. If my explaination helpful, feel free to interact with the system accordingly!
Thank you!