A fully modal WPF window?

I have a requirement that indicates that a notification tray application using WPF should (based on some conditions) pop up in a window that is globally modal. This should prevent the user from doing anything (even outside the Tray application) until he satisfies other conditions, and at this time he activates the close button and allows the user to close it.

How to make such a window? My window is displayed, and it evaluates the conditions and much more, but it is only modal for the application (i.e., it blocks execution and the user interface for the application in which it works.

I suppose I can create a borderless window and possibly turn off the minimize function, but they can still access the Start menu. Any takers? That I am striving for functionality is similar to the Windows UAC / Admin privilege request window.

This is not a duplicate of the question provided by the duplicate at the top. This question relates to Windows Forms and is not applicable to WPF. Be that as it may, I received an answer that worked well for me, and that was not the answer to the question posed above. Not that it really mattered, but I would like the duplicate removed. I like to think that I study my questions pretty well before posting and add that the tag implies that I do not.

EDIT

This question is not a duplicate of the question associated with the Duplicate Question block. This question was answered in the style of Windows Forms, and I use WPF, a completely different user interface structure.

+4
source share
2 answers

Use the Window.ShowDialog() method. More information can be found here.

See the second comment on six-digit variables.

+5
source

One solution would be to create a translucent WPF window that spans the entire screen (actually you have to say: all screens) and show a modal window using Window.ShowDialog() , with the window owning it. All you have to do is to prevent task switching (this is not an easy task), but maybe this is enough?

Does something like UAC do - for example, like in this answer?

+1
source

All Articles