title: Detecting scrolling past edge of ScrollViewer
body: <p>I am simply wondering if it is possible, and how, to detect if an element within a ScrollViewer has been dragged past the edge of the viewer.</p>
  
  <p>For instance, by dragging an image more than is allowed, the image is automatically positioned back within the ScrollViewer, indicating that at least the backend knows that the image/scroll has been dragged past its boundary. What I would want to do is to also detect when the boundary is crossed and then perform an action, such as treating the user activity as a swipe and changing the displayed item to something else.</p>
  
  <p><strong>XAML illustration</strong></p>
  
  <pre><code>&lt;ScrollViewer x:Name="detailImageScroll" ZoomMode="Enabled"&gt;
      &lt;Image x:Name="detailImage" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center"/&gt;
  &lt;/ScrollViewer&gt;
  </code></pre>
  
  <p><strong>C# pseudocode illustration</strong></p>
  
  <pre><code>SomeScrollManipulationEvent()
  {
    if detailImage.left &lt; detailImageScroll.left
      GoToPreviousImage()
    else if detailImage.right &gt; detailImageScroll.right
      GoToNextImage()
  }
  </code></pre>
  
  <p>What I have come up with so far is that manipulations is not possible within ScrollViewers nor its images, at least not without losing the functionality of the ScrollViewer, e.g. zooming and panning.</p>
  
  <p><em>Is it event possible for me to implement the proposed functionality? If so, how?</em></p>
  
  <p>Thanks!</p>