The parameter should be to allow the window class to maintain a static reference to the instance of itself. In the window class, you also put the static Display() method, allowing the window class to handle creating and deleting instances. Basically you have to move your code to your Windows class.
private static DisplayWindow _window; public static void Display() { if (_window == null) { _window = new DisplayWindow(); _window.Closed += delegate { _window = null; }; _window.Show(); } _window.BringIntoView(); }
In another class
DisplayWindow.Display();
If you want to prevent the wild creation of windows of this type, make the window constructor closed
private DisplayWindow() { }
This causes other classes to call Display() if they want to open this window.
source share