Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use Layout Updated Here's code I used and debugged to get the scrolling effect. You might also need to keep a track where the pointer has been pressed and the scroll viewer manipulation completed event. Here's the xaml Add the respective event handler in the code behind.</p> <pre><code> &lt;ScrollViewer ManipulationCompleted="ScrollViewer_ManipulationCompleted" ManipulationMode="All"&gt; &lt;StackPanel LayoutUpdated="StackPanel_LayoutUpdated" PointerPressed="StackPanel_PointerPressed"&gt; &lt;Grid Height="100" Width="100" Background="Red" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Green" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Blue" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Yellow" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Red" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Green" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Blue" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Yellow" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Red" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Green" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Blue" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Yellow" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Red" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Green" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Blue" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Yellow" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Red" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Green" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Blue" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Yellow" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Red" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Green" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Blue" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Yellow" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Red" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Green" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Blue" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Yellow" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Red" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Green" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Blue" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Yellow" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Red" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Green" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Blue" &gt;&lt;/Grid&gt; &lt;Grid Height="100" Width="100" Background="Yellow" &gt;&lt;/Grid&gt; &lt;/StackPanel&gt; &lt;/ScrollViewer&gt; </code></pre> <p>Here's the code behind</p> <pre><code> public MainPage() { this.InitializeComponent(); } /// &lt;summary&gt; /// Invoked when this page is about to be displayed in a Frame. /// &lt;/summary&gt; /// &lt;param name="e"&gt;Event data that describes how this page was reached. The Parameter /// property is typically used to configure the page.&lt;/param&gt; protected override void OnNavigatedTo(NavigationEventArgs e) { } private void ScrollViewer_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) { //scroll bar being dragged } private void StackPanel_LayoutUpdated(object sender, object e) { //if swipe gesture then check for vertical offset and carry on with the //calculations you have to do else do nothing } private void StackPanel_PointerPressed(object sender, PointerRoutedEventArgs e) { //swipe gesture being made } </code></pre> <p>Please let me know if it worked</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload