public void callDemoWindow() { if (demoWindow != null) { demoWindow.Show(); return; } demoWindow = new DemoWindow(); demoWindow.Closed += (o, args) => { demoWindow = null; }; demoWindow.Show(); }