title: Programmatically created CheckBox does not fire Checked/Unchecked events
body: <p>I have a simple WPF application that uses a "frame" for multi-page navigation. One of that pages creates a series of <code>CheckBoxes</code> and adds a couple of handlers (<code>Checked</code>/<code>Unchecked</code>) for each checkbox created. The <code>CheckBoxes</code> work as intended and are programmatically accessible, they can be checked or unchecked by click but none of the two events is ever fired if I click. </p>
  
  <p>Here is the creation of the <code>CheckBoxes</code>:</p>
  
  <pre><code>ModuleStackpanels[i].Children.Add(ModuleCheckBoxes[i]);
  StackPanel.SetZIndex(ModuleCheckBoxes[i], 2);
  ModuleCheckBoxes[i].Checked += new RoutedEventHandler(ModuleCheckBoxClick);
  ModuleCheckBoxes[i].Unchecked += new RoutedEventHandler(ModuleCheckBoxClick);
  </code></pre>
  
  <p>Where I go from 0 to 30. Then I have the handler:</p>
  
  <pre><code>private void ModuleCheckBoxClick(object sender, RoutedEventArgs e)
  {
      int CheckBoxCounter = 0;
  
      for(int i=0;i&lt;30;i++)
      {
          if (ModuleCheckBoxes[i].IsChecked == true) CheckBoxCounter++;
      }
  
      if(CheckBoxCounter &gt; 1)
      {
          Button_QueryStatus.IsEnabled = false;
      }
  }
  </code></pre>
  
  <p>But nothing is fired.
  Someone has got an idea?</p>