title: WPF Why my scrollview with panning mode is blocking button.touchdown inside it?
body: <p>The problem i'm investigating is about  Button.Touchdown/up triggers on a Button with a style. OK this buttons are inside a ScrollViewer, this one has a panning-mode property and it's enabled. The situation is when i test my aplication with a TouchScreen and i try to drag with my finger the panel, it moves and then i touch any button the trigger TouchDown doesn't show the style effects. </p>
  
  <p>If i set panning-mode to false, then i try again to press the button it shows the style effects. </p>
  
  <p>The question is. Is any solution for this panning-mode issue?</p>
  
  <p>Look my Code:</p>
  
  <p>WindowApp.xaml</p>
  
  <pre><code>    &lt;Window x:Class="WPFScrollviewButtonsEffects.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Window.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;ResourceDictionary.MergedDictionaries&gt;
                  &lt;ResourceDictionary Source="/webcontent/StylesPanelServices.xaml"/&gt;
              &lt;/ResourceDictionary.MergedDictionaries&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/Window.Resources&gt;
      &lt;Grid&gt;
          &lt;ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" PanningMode="Both"&gt;
              &lt;StackPanel Width="500" Height="500"&gt;
                  &lt;StackPanel Orientation="Horizontal" Margin="20,15,0,15"&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                  &lt;/StackPanel&gt;
                  &lt;StackPanel Orientation="Horizontal" Margin="20,15,0,15"&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                  &lt;/StackPanel&gt;
                  &lt;StackPanel Orientation="Horizontal" Margin="20,15,0,15"&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                  &lt;/StackPanel&gt;
                  &lt;StackPanel Orientation="Horizontal" Margin="20,15,0,15"&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                  &lt;/StackPanel&gt;
                  &lt;StackPanel Orientation="Horizontal" Margin="20,15,0,15"&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                      &lt;Button Height="34" Width="120" Content="Button1"/&gt;
                  &lt;/StackPanel&gt;
              &lt;/StackPanel&gt;
          &lt;/ScrollViewer&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>WindowApp.cs</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Data;
  using System.Windows.Documents;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Imaging;
  using System.Windows.Navigation;
  using System.Windows.Shapes;
  
  namespace WPFScrollviewButtonsEffects
  {
      /// &lt;summary&gt;
      /// Lógica de interacción para MainWindow.xaml
      /// &lt;/summary&gt;
      public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
          }
      }
  }
  </code></pre>
  
  <p>StylesPanelServices.xaml</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
  
      &lt;SolidColorBrush x:Key="AzulOscuro" Color="#FF005E91"/&gt;
      &lt;Style TargetType="{x:Type Button}"&gt;
          &lt;Setter Property="FontFamily" Value="Arial"/&gt;
          &lt;Setter Property="FontSize" Value="8"/&gt;
          &lt;Setter Property="FontWeight" Value="Light"/&gt;
          &lt;Setter Property="FontStyle" Value="Normal"/&gt;
          &lt;Setter Property="Margin" Value="15,0,15,0"/&gt;
          &lt;Setter Property="MinHeight" Value="55"/&gt;
          &lt;Setter Property="TextBlock.TextAlignment" Value="Center"/&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                      &lt;ControlTemplate.Resources&gt;
                          &lt;Storyboard x:Key="Storyboard1"&gt;
                              &lt;ColorAnimation 
                                  Storyboard.TargetName="btnborder"
                                  Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"                                        
                                  To="#FF005E91" Duration="00:00:0.08"/&gt;
                              &lt;DoubleAnimation BeginTime="0" Duration="0" Storyboard.TargetProperty="(Effect).Opacity" Storyboard.TargetName="imagen" To="1"/&gt;
                          &lt;/Storyboard&gt;
                          &lt;Storyboard x:Key="Storyboard2"&gt;
                              &lt;ColorAnimation 
                                  Storyboard.TargetName="btnborder"
                                  Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"                                        
                                  To="White" Duration="00:00:0.08"/&gt;
                              &lt;DoubleAnimation BeginTime="0" Duration="0" Storyboard.TargetProperty="(Effect).Opacity" Storyboard.TargetName="imagen" To="0"/&gt;
                          &lt;/Storyboard&gt;
                          &lt;Storyboard x:Key="GlowOn"&gt;
                              &lt;DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(Effect).Opacity" Storyboard.TargetName="imagen"&gt;
                                  &lt;SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/&gt;
                              &lt;/DoubleAnimationUsingKeyFrames&gt;
                          &lt;/Storyboard&gt;
                          &lt;Storyboard x:Key="GlowOff"&gt;
                              &lt;DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(Effect).Opacity" Storyboard.TargetName="imagen"&gt;
                                  &lt;SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/&gt;
                              &lt;/DoubleAnimationUsingKeyFrames&gt;
                          &lt;/Storyboard&gt;
                      &lt;/ControlTemplate.Resources&gt;
                      &lt;Grid&gt;
                          &lt;Border x:Name="btnborder" Background="#FFFFFFFF" CornerRadius="10" BorderBrush="#FF009ADA" BorderThickness="1"&gt;
                              &lt;ContentPresenter x:Name="imagen" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,2,5,3"&gt;
                                  &lt;ContentPresenter.Effect&gt;
                                      &lt;DropShadowEffect ShadowDepth="0" Color="White" Opacity="0.9" BlurRadius="10"/&gt;
                                  &lt;/ContentPresenter.Effect&gt;
                              &lt;/ContentPresenter&gt;
                          &lt;/Border&gt;
                      &lt;/Grid&gt;
                      &lt;ControlTemplate.Triggers&gt;
                          &lt;Trigger Property="IsPressed" Value="true"&gt;
                              &lt;Trigger.ExitActions&gt;
                                  &lt;BeginStoryboard Storyboard="{StaticResource Storyboard2}"/&gt;
                              &lt;/Trigger.ExitActions&gt;
                              &lt;Trigger.EnterActions&gt;
                                  &lt;BeginStoryboard Storyboard="{StaticResource Storyboard1}"/&gt;
                              &lt;/Trigger.EnterActions&gt;
                          &lt;/Trigger&gt;
                      &lt;/ControlTemplate.Triggers&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>