WPF disable main window while second window is open until it closed

There is a difference between the ShowDialog() and Show() methods. ShowDialog() makes the child window active and remain active until it is closed; however, the Show() method opens a new window and treats it as a separate entity. In this case, on every click, a new window gets launched.

E.g.

Window1 childWin= new Window1();
childWin.ShowDialog();
OR
childWin.Show();

Try this ShowDialog method instead of Show to open the second window as a dialog.

  1. You have a WPF project already with a window. This app should work.

  2. Right click on project and Add new Window. You name it Window1.xaml

  3. You would now notice Window1.xaml and Window1.xaml.cs added to your project. (the class name for the window would be Window1 which is in the .xaml.cs file and it derives from Window; also a partial class)

  4. Open the XAML file for the Window1 (Window1.xaml) and add your controls. Treat it like any other window and write code.

  5. Now in your main window (the first one) you add a Button which when clicked should show the newly created window.

For that inside the Click handler, ....

var newWindow = new Window1();
newWindow.ShowDialog();

This Window1 should be the design for your About page. Invoking it with ShowDialog(); disables the other windows and the only active window will be your about page.