How to change amount of scroll through Scroll Viewer in UWP XAML/C#? -


i using listview display items, let of height 100. in case of many items, vertical scroll bar displayed scrollviewer properties. however, when user scrolls through list, getting scrolled half of screen @ time 1 scrolls covers entire list view.

i want have code set amount of scroll, 100 height @ time. tried searching through doc didn't find any. data comes binding , number of items varies, fine have fixed height each item.

sample code:

<listview name="lvsummarylist" scrollviewer.verticalscrollmode="enabled"                                               scrollviewer.isverticalrailenabled="true"                                               verticalalignment="bottom"                                               selectionmode="none"                                          scrollviewer.verticalscrollbarvisibility="auto"                                                  scrollviewer.horizontalscrollmode="disabled"              scrollviewer.isverticalscrollchainingenabled="true"                                               margin="0,5,10,0"                                               maxheight="600" >                 <listview.itemspanel>                     <itemspaneltemplate>                         <itemswrapgrid orientation="horizontal" grouppadding="1"  margin="1" minheight="100" maxheight="200" maximumrowsorcolumns="4" verticalalignment="center"/>                     </itemspaneltemplate>                 </listview.itemspanel>  </listview> 

how accomplish this, there property or available override current behavior?

an easier way achieve effect sounds you're trying achieve enable snap points on scrollviewer.

use following style of listview:

        <style targettype="listview"                x:key="snaplistviewstyle">             <setter property="template">                 <setter.value>                     <controltemplate targettype="listview">                         <border borderbrush="{templatebinding borderbrush}"                                 background="{templatebinding background}"                                 borderthickness="{templatebinding borderthickness}">                             <scrollviewer x:name="scrollviewer"                                           tabnavigation="{templatebinding tabnavigation}"                                           horizontalscrollmode="{templatebinding scrollviewer.horizontalscrollmode}"                                           horizontalscrollbarvisibility="{templatebinding scrollviewer.horizontalscrollbarvisibility}"                                           ishorizontalscrollchainingenabled="{templatebinding scrollviewer.ishorizontalscrollchainingenabled}"                                           verticalscrollmode="{templatebinding scrollviewer.verticalscrollmode}"                                           verticalscrollbarvisibility="{templatebinding scrollviewer.verticalscrollbarvisibility}"                                           isverticalscrollchainingenabled="{templatebinding scrollviewer.isverticalscrollchainingenabled}"                                           ishorizontalrailenabled="{templatebinding scrollviewer.ishorizontalrailenabled}"                                           isverticalrailenabled="{templatebinding scrollviewer.isverticalrailenabled}"                                           verticalsnappointsalignment="near"                                           verticalsnappointstype="mandatorysingle"                                           zoommode="{templatebinding scrollviewer.zoommode}"                                           isdeferredscrollingenabled="{templatebinding scrollviewer.isdeferredscrollingenabled}"                                           bringintoviewonfocuschange="{templatebinding scrollviewer.bringintoviewonfocuschange}"                                           automationproperties.accessibilityview="raw">                                 <itemspresenter header="{templatebinding header}"                                                 headertemplate="{templatebinding headertemplate}"                                                 headertransitions="{templatebinding headertransitions}"                                                 footer="{templatebinding footer}"                                                 footertemplate="{templatebinding footertemplate}"                                                 footertransitions="{templatebinding footertransitions}"                                                 padding="{templatebinding padding}" />                             </scrollviewer>                         </border>                     </controltemplate>                 </setter.value>             </setter>         </style> 

if doesn't give effect you're going for, try different values verticalsnappointstype , verticalsnappointsalignment.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -