Minimize window from usercontrol to wpf

I want to minimize my window when I open another window /

This is the method in my user control, which is in another user control, which is also in another user control.

WindowUploadFiles windowUploadFiles=new WindowUploadFiles(); //Minimize() - how to ? windowUploadFiles.ShowDialog(); // Maximize() - how to ? 

Anyone facing this problem?

+4
source share
1 answer

You can use the WindowState property to minimize / maximize / restore a window:

 // Find the window that contains the control Window window = Window.GetWindow(this); // Minimize window.WindowState = WindowState.Minimized; // Restore window.WindowState = WindowState.Normal; 
+7
source

All Articles