title: How do I determine if a WPF window is modal?
body: <p>What's the easiest way to figure out if a window is opened modally or not?</p>
  
  <p><strong>CLARIFICATION:</strong></p>
  
  <p>I open a window calling </p>
  
  <pre><code>myWindow.ShowDialog();
  </code></pre>
  
  <p>I have a footer with an "OK" &amp; "Cancel" button that I only want to show if the window is opened modally. Now I realize I can set a property by doing this:</p>
  
  <pre><code>myWindow.IsModal = true;
  myWindow.ShowDialog();
  </code></pre>
  
  <p>But I want the window itself to make that determination. I want to check in the <code>Loaded</code> event of the window whether or not it is modal.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The <code>IsModal</code> property doesn't <em>actually</em> exist in a WPF window. It's a property that I have created. <code>ShowDialog()</code> blocks the current thread. </p>
  
  <p>I'm guessing I can determine if the Window is opened via <code>ShowDialog()</code> by checking if the current thread is blocked. How would I go about doing that?</p>