0

In our WPF app we have one Main Window and a bunch of buttons that open pop-up Edit/ReadOnly Windows. In the Main Window we also have a ContentControl that gives notifications in the bottom right corner.

What I want to achieve is to have these notifications pop-up in the very front of all Windows. I know I can use Panel.ZIndex to make it the front View-Element inside the (Main) Window itself, but I'd also want it on top of the pop-up Windows that might be in front of it.

Is there a way to achieve this? I know I could put this ContentControl with Notifications inside a seperate Window instead of the MainWindow itself, but then I'd had to remove the borders and bar of the Window, remove it from the Windows Taskbar at the bottom and a bunch of other stuff to make it look/act the same as it is right now, which I preferably avoid.

So, what is the best way to approach this and is it even possible without putting it in a seperate Window, and have that pop up in front of every other window every time a new Notifications comes up?

Kevin Cruijssen
  • 9,153
  • 9
  • 61
  • 135

1 Answers1

1

Unfortunately, you don't have a choice to make as the only way to make your ContentControl appear on top of other Windows is to put it into its own Window and set its TopMost property to true. As it is, the Panel.ZIndex will only affect the Z index of the control within the MainWindow... you can't set it to be displayed above the level of the parent Window.

So in short, your solution is to add your ContentControl to a custom Window and make that appear on top.

Sheridan
  • 68,826
  • 24
  • 143
  • 183
  • I was indeed afraid that might be the case.. I'll await some more answers, try some things out and most likely make a new question since I don't really know how to make a Window appear borderless (also excluding the `- [] X` at the top right) and also let it not appear in the Windows Task Bar.. Will probably make this issue a lower priority though, since we have some more things to do in our project before the holidays. – Kevin Cruijssen Dec 18 '14 at 09:30
  • 1
    Please don't ask duplicate questions here... there are many examples of borderless `Window`s already online, eg. [WPF borderless window with shadow VS2012 style](http://stackoverflow.com/questions/14730311/wpf-borderless-window-with-shadow-vs2012-style). – Sheridan Dec 18 '14 at 10:44