 <p>You can handle PreviewMouseDown Event of the ScrollViewer. In your xaml:</p> <pre><code>&lt;Grid&gt; &lt;!--Button is removed as it will be not used--&gt; &lt;ScrollViewer Background="{x:Null}" Margin="20" PreviewMouseDown="ScrollViewer_MouseDown"&gt; &lt;StackPanel Orientation="Horizontal" Background="{x:Null}"&gt; &lt;Rectangle Fill="Red" Width="100" Margin="50"&gt;&lt;/Rectangle&gt; &lt;Rectangle Fill="Red" Width="100" Margin="50"&gt;&lt;/Rectangle&gt; &lt;Rectangle Fill="Red" Width="100" Margin="50"&gt;&lt;/Rectangle&gt; &lt;Rectangle Fill="Red" Width="100" Margin="50"&gt;&lt;/Rectangle&gt; &lt;/StackPanel&gt; &lt;/ScrollViewer&gt; &lt;/Grid&gt; </code></pre> <p>As It is PreviewMouseDown (Tunneling) Event. So Wherever you click on scrollviewer, Event will be fired Whether it is Rectangle or ScrollViewer itself.</p> <p>In your code behind, You can handle it by e.Source Parameter. PreviewMouseDown Event in .cs file is:</p> <pre><code>private void ScrollViewer_PreviewMouseDown(object sender, MouseButtonEventArgs e) { if (e.Source.GetType() == typeof(ScrollViewer)) { //Code which you want to perform on that Button click will be here. } if (e.Source.GetType() == typeof(Rectangle)) { //Code which you want to perform on rectangle will be here. } } </code></pre> <p>I hope it will help you.</p>