title: Proper way to ask if a Window is open in WPF
body: <p>I have this click event in my main window to open a new window</p>
  
  <pre><code>private void Button_Click(object sender, RoutedEventArgs e)
  {
      cm = new CanalesMain();
  
      cm.Show();
  
      cm.Canales.setValues();
  
  }
  </code></pre>
  
  <p>My cm variable is defined as a member class in my main window because I need to load/refresh the setValues() method every 5 minutes (there's a TimeSpan and a EventHandler for that)</p>
  
  <p>The thing is, in my "refresh data" method I have this if statement to ask if the cm variable is loaded and is not null (I mean, if the window was ever opened or if is opened, ask if isn't closed)</p>
  
  <pre><code>if (cm!=null &amp;&amp; cm.IsLoaded)
  {
      cm.Canales.setValues();
  }
  </code></pre>
  
  <p>Is this the correct or best way to ask if my window is open?</p>