title: Xaml: MouseLeftButtonUp event not working
body: <p>I have a xaml code for Button declared as ControlTemplate
  <code>App.xaml</code></p>
  
  <pre><code> &lt;!--Style for button start here--&gt;
    &lt;Style  x:Key="myButtonStyle" TargetType="Border"&gt;
    &lt;EventSetter Event="Border.MouseLeftButtonDown" Handler="ButtonDown" /&gt;
      &lt;EventSetter Event="Border.MouseLeftButtonUp" Handler="ButtonUp" /&gt;
      &lt;EventSetter Event="Border.MouseEnter" Handler="ButtonEnter" /&gt;
      &lt;EventSetter Event="Border.MouseLeave" Handler="ButtonLeave"/&gt;
  
  &lt;/Style&gt;
  
  &lt;!--Style for myButtonStyle ends here--&gt;
  
  &lt;!--Control Template for button start here--&gt;
  &lt;ControlTemplate TargetType="Button" x:Key="buttonPrimary"&gt;
      &lt;Grid Width="{TemplateBinding Width}"&gt;
          &lt;Border Height="35" Width="{TemplateBinding Width}" Style="{StaticResource myButtonStyle}"  Background="{TemplateBinding Background}" CornerRadius="3" Loaded="borderLoaded"  x:Name="myButton"&gt;
                  &lt;ContentPresenter  HorizontalAlignment="Center"  VerticalAlignment="Center" &gt;
                      &lt;TextBlock.Foreground&gt;
                          White
                      &lt;/TextBlock.Foreground&gt;
                      &lt;TextBlock.FontSize&gt;14&lt;/TextBlock.FontSize&gt;
  
                  &lt;/ContentPresenter&gt;
          &lt;/Border&gt;
      &lt;/Grid&gt;
  
  &lt;/ControlTemplate&gt; 
  </code></pre>
  
  <p>And In another file I have handled all mouse event ..
  <code>Main.cs</code></p>
  
  <pre><code> private void ButtonDown(object sender, RoutedEventArgs e)
     {
         Console.WriteLine("ButtonDown");
  
     }//Button Down method ends here
  
  
     private void ButtonUp(object sender, RoutedEventArgs e)
     {
         Console.WriteLine("Button Up");
  
     }//ButtonUp method ends here
  
  
     private void ButtonLeave(object sender, RoutedEventArgs e)
     {
         Console.WriteLine("ButtonLeave");
     }
  
  
     private void ButtonEnter(object sender, RoutedEventArgs e)
     {
         Console.WriteLine("ButtonEnter");
     }
  </code></pre>
  
  <p>In main.xaml I am calling these button..
  <code>Main.xaml</code></p>
  
  <pre><code> &lt;Button   Content="ButtonPrimary" Width="110" Background="#428bca" Template="{StaticResource buttonPrimary}"  /&gt;
  </code></pre>
  
  <p>All the event are firing except MouseLeftButtonUp ..??</p>