tags:

views:

13

answers:

1

I want to minimize my window , when I open other window/

This is a method in my user control which is in another user control, which is in another user control too.

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

Has anybody experience with this problem ?

+1  A: 

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

// Find the window that contains the control
Window window = Window.GetWindow(this);

// Minimize
window.WindowState = WindowState.Minimized;

// Restore
window.WindowState = WindowState.Normal;
Thomas Levesque
Thank you Thomas :)