In a WPF window, how do I know if it is opened?
My goal to open only 1 instance of the window at the time.
So, my pseudo code in the parent window is:
You can check if m_myWindow==null and only then create and show window. When the window closes set the variable back to null.
m_myWindow==null
if (this.m_myWindow == null) { this.m_myWindow = new MyWindow(); this.m_myWindow.Closed += (sender, args) => this.m_myWindow = null; this.m_myWindow.Show(); }