How to minimize the owner window when showing a modality?

I have an application that on the first boot will show a modal window for user login (window without fields). Now, when the user wants to minimize the application by clicking the "Minimize" button in the main window, this cannot be done if the main window is blocked by a modal window. When a user tries to click the application taskbar, it still will not be minimized.

How can I enable minimization of the application when showing the mod (using the taskbar of the main window)?

+5
source share
1 answer

. , , , - ( ).

( - ):

void btnLogin_Click(object sender, RoutedEventArgs e)
{
    MyLoginDialog dialog = new MyLoginDialog();
    dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
    dialog.WindowState = WindowState.Normal;

    this.WindowState= WindowState.Minimized;
    // Can also do this to completely hide the main window:
    // this.Visibility = Visibility.Collapsed;

    dialog.ShowDialog();            
}
+3

All Articles