title: Xaml Border input binding prevents animation on MouseDown
body: <p>I've created a user control which acts similar to a button (see code below).</p>
  
  <p>To get the user control animation I used EventTriggers to the mouse events (Enter/Leave, Down/Up).</p>
  
  <p>After I've added the InputBinding to the MouseClick </p>
  
  <pre><code>&lt;Border.InputBindings&gt;
      &lt;MouseBinding Command="{Binding ClickCommand}" MouseAction="LeftClick" /&gt;
  &lt;/Border.InputBindings&gt;
  </code></pre>
  
  <p>The animation of the MouseDown doesn't work anymore. Any suggestions how to add the ClickCommand and keeping the animation?</p>
  
  <pre><code>&lt;UserControl x:Class="DauertestViewer.StationItemControl"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               xmlns:local="clr-namespace:DauertestViewer"
               mc:Ignorable="d" 
               d:DesignHeight="150" d:DesignWidth="150"&gt;
  
  
      &lt;UserControl.Resources&gt;
          &lt;Style x:Key="ContentStyle" TargetType="{x:Type ContentControl}"&gt;
              &lt;Setter Property="Background" Value="White" /&gt;
              &lt;Setter Property="Foreground" Value="#363637" /&gt;
              &lt;Setter Property="BorderThickness" Value="5" /&gt;
              &lt;Setter Property="FontSize" Value="14" /&gt;
              &lt;Setter Property="Height" Value="150" /&gt;
              &lt;Setter Property="Width" Value="150" /&gt;
  
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type ContentControl}" &gt;
                          &lt;Border x:Name="border" 
                                  Background="{TemplateBinding Background}"
                                  BorderBrush="{TemplateBinding BorderBrush}" 
                                  BorderThickness="{TemplateBinding BorderThickness}" 
                                  SnapsToDevicePixels="True"
                                  CornerRadius="0"
                                  Margin="10"&gt;
                              &lt;Border.Effect&gt;
                                  &lt;DropShadowEffect
                                      x:Name="dropshadow"
                                      ShadowDepth="4"
                                      Direction="300"
                                      Color="#363637"
                                      Opacity="0.4"
                                      BlurRadius="4"/&gt;
                              &lt;/Border.Effect&gt;
                              &lt;Border.InputBindings&gt;
                                  &lt;MouseBinding Command="{Binding ClickCommand}" MouseAction="LeftClick" /&gt;
                              &lt;/Border.InputBindings&gt;
                              &lt;Grid&gt;
                                  &lt;Grid.RowDefinitions&gt;
                                      &lt;RowDefinition Height="2*" /&gt;
                                      &lt;RowDefinition Height="*" /&gt;
                                  &lt;/Grid.RowDefinitions&gt;                              
                                  &lt;Viewbox Grid.Row="0" Margin="5 8 5 5" &gt;
  
                                  &lt;/Viewbox&gt;
                                  &lt;TextBlock Grid.Row="1" 
                                             Margin="0 0 0 2" 
                                             Text="{Binding StationName, FallbackValue=Dauertest}" 
                                             FontFamily="{TemplateBinding FontFamily}" 
                                             Foreground="{TemplateBinding Foreground}" 
                                             FontSize="{TemplateBinding FontSize}" 
                                             FontWeight="Regular"
                                             TextWrapping="Wrap"                                           
                                             TextAlignment="Center" 
                                             VerticalAlignment="Center" &gt;
                                  &lt;/TextBlock&gt;
                              &lt;/Grid&gt;
                          &lt;/Border&gt;
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;EventTrigger RoutedEvent="MouseEnter" SourceName="border"&gt;
                                  &lt;BeginStoryboard&gt;
                                      &lt;Storyboard TargetName="dropshadow"&gt;
                                          &lt;DoubleAnimation
                                              Storyboard.TargetProperty="BlurRadius" 
                                              Duration="0:0:0.2" 
                                              From="4" 
                                              To="10" /&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/BeginStoryboard&gt;
                              &lt;/EventTrigger&gt;
                              &lt;EventTrigger RoutedEvent="MouseLeave" SourceName="border"&gt;
                                  &lt;BeginStoryboard&gt;
                                      &lt;Storyboard TargetName="dropshadow"&gt;
                                          &lt;DoubleAnimation
                                              Storyboard.TargetProperty="BlurRadius" 
                                              Duration="0:0:0.2" 
                                              From="10" 
                                              To="4" /&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/BeginStoryboard&gt;
                              &lt;/EventTrigger&gt;
                              &lt;EventTrigger RoutedEvent="MouseDown" SourceName="border"&gt;
                                  &lt;BeginStoryboard&gt;
                                      &lt;Storyboard TargetName="border"&gt;
                                          &lt;ThicknessAnimation
                                              Storyboard.TargetProperty="Margin" Duration="0:0:0.2" 
                                              From="10,10,10,10" To="10,10,15,15" /&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/BeginStoryboard&gt;
                              &lt;/EventTrigger&gt;
                              &lt;EventTrigger RoutedEvent="MouseUp" SourceName="border"&gt;
                                  &lt;BeginStoryboard&gt;
                                      &lt;Storyboard TargetName="border"&gt;
                                          &lt;ThicknessAnimation
                                              Storyboard.TargetProperty="Margin" Duration="0:0:0.2" 
                                              From="10,10,15,15" To="10,10,10,10" /&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/BeginStoryboard&gt;
                              &lt;/EventTrigger&gt;
                          &lt;/ControlTemplate.Triggers&gt;
                    &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
      &lt;/UserControl.Resources&gt;
  
      &lt;ContentControl Style="{StaticResource ContentStyle}"/&gt;
  </code></pre>
  
  <p>The ViewModel:</p>
  
  <pre><code>using System.Net;
  using System.Net.NetworkInformation;
  using System.Windows.Input;
  
  namespace DauertestViewer
  {
      public class StationItemViewModel : BaseViewModel
      {
          public StationItem StationItem { get; set; }
  
          public string IconColor { get; set; }
  
          public string IconName { get; set; }
  
          public ICommand ClickCommand { get; set; }
  
          public bool UpdateConnectionStatusInProgress { get; set; }
  
          public ConnectionStatus CurrentConnectionStatus { get; set; }
  
          public StationItemViewModel()
          {
              ClickCommand = new RelayCommand(() =&gt; PingIpAddress(IPAddress.Parse("192.168.0.230")));
          }
  
          private async void PingIpAddress(IPAddress StationIP)
          {
              await RunCommand(() =&gt; this.UpdateConnectionStatusInProgress, async () =&gt;
              {
                  Ping pingSender = new Ping();
                  PingReply pingReply = await pingSender.SendPingAsync(StationIP, 10000);
  
                  if (pingReply.Status == IPStatus.Success)
                  {
                      this.CurrentConnectionStatus = ConnectionStatus.Connected;
                  }
                  else
                  {
                      this.CurrentConnectionStatus = ConnectionStatus.NotConnected;
                  }
              });
          }
      }
  }
  </code></pre>
  
  <p>If I comment out the ClickCommand in the constructor everything works fine - it is something related to the RelayCommand itself....</p>