title: How to disable all buttons
body: <p>I have a method that disables all the butttons on my window.
  But i can't seem to get the type of Button to match it to the Resource collection</p>
  
  <p>I'm using Expression Blend 3 with a c# code-behind</p>
  
  <pre><code>void DisableButtons()
      {
          for(int i = 0; i&gt;= this.Resources.Count -1; i ++)
          {
              if (this.Resources[i].GetType() == typeof(Button))
              {
                  Button btn = (Button)this.Resources[i];
                  btn.IsEnabled = false;
              }
          }
  
      }
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>Thanks for the answers!
  Ok The loop is working but my code is incorrect.
  <code>this.Resources</code>
  Does not seem to include my buttons! This could be an <strong>Blend</strong> thing?</p>
  
  <p>So Yeah.
  I ended up doing it manually. Cause I'm hasty and there isn't a short easy solution. Thanks for all the input though!</p>