title: How can I raise a custom Routed Event from user control?
body: <p>In my user control I have a button that, when clicked, would raise a custom Routed Event. I've attempted to raise it, but it doesn't get fired in the MainWindow.xaml. </p>
  
  <p>Xaml for the button in UserControl:</p>
  
  <pre><code>&lt;Button x:Name="PART_Add" Content="+" Grid.Column="3" Margin="0,0,0,0" Style="{DynamicResource dTranspButton}" Click="btnAdd_Click"/&gt;
  </code></pre>
  
  <p>UserControl C# code: </p>
  
  <pre><code>//AddClick Event
  
          public static readonly RoutedEvent AddClickEvent = EventManager.RegisterRoutedEvent("AddClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(dCB_Props));
  
          public event RoutedEventHandler AddClick
          {
              add { AddHandler(AddClickEvent, value); }
              remove { RemoveHandler(AddClickEvent, value); }
          }
  
          void RaiseAddClickEvent()
          {            
              RoutedEventArgs newEventArgs = new RoutedEventArgs(dCB_Props.AddClickEvent);
          }
  
          protected void OnAddClick()
          {
              RaiseAddClickEvent();
          }
  
  //objects events
  
          private void btnAdd_Click(object sender, System.Windows.RoutedEventArgs e)
          {
              RaiseAddClickEvent();
          }
  </code></pre>
  
  <p>Xaml Code for the UserControl Instance in MainWindow.xaml:</p>
  
  <pre><code>&lt;local:dCB_Props x:Name="cb1" Margin="41.166,0,36.19,25" VerticalAlignment="Bottom" Height="30" Width="141" AddClick="dCB_Props_AddClick"&gt;
      &lt;local:dCB_Props.Items&gt;
          &lt;ComboBoxItem Content="item1"/&gt;
      &lt;/local:dCB_Props.Items&gt;
  &lt;/local:dCB_Props&gt;
  </code></pre>
  
  <p>C# Code that should get fired in MainWindow.xaml.cs:</p>
  
  <pre><code>private void dCB_Props_AddClick(object sender, System.Windows.RoutedEventArgs e)
  {
      MessageBox.Show("This Works");
  }
  </code></pre>