c# - Custom panoramic control with edge snaping -


i trying create 'panoramacontrol' control windows phone 8, in terms displays slideshow of scenes, each of them having size of screenwidth. have tried using microsoft's panorama control have abandoned approach several reasons:

  • the amount of scenes around 10-20, , might panoramacontrol handle, because there animation inside.
  • i don't want control loop continuously, , panoramacontrol does.

after research decided implement control on own, using scrollviewer , listbox, , result here: https://www.youtube.com/watch?v=2rcqdmkn0ey (the movement smooth on both device , emulator, bit choppy in link due screen capture)

what missing however, scene scene snap-to-edge elastic functionality. have tried playing manipulation events, fail smooth elastic inertial movement , thought of asking suggestion towards elegant implementation before getting frustration or worse.. hacking , compromising..

therefore or suggestions (even towards different approaches) appreciated! :)

<grid x:name="layoutroot">      <grid.rowdefinitions>         <rowdefinition height="8*"/>         <rowdefinition height="10*"/>         <rowdefinition height="1*"/>     </grid.rowdefinitions>      <grid.columndefinitions>         <columndefinition width="1*"/>         <columndefinition width="14*"/>         <columndefinition width="1*"/>     </grid.columndefinitions>      <scrollviewer grid.row="0" grid.rowspan="3" grid.column="0" grid.columnspan="3" name="scrollviewer" verticalscrollbarvisibility="disabled" horizontalscrollbarvisibility="auto">     <listbox name="listboxscenes"  itemssource="{binding scenes}" scrollviewer.verticalscrollbarvisibility ="disabled" selecteditem="{binding selectedscene, mode=twoway}">          <listbox.itemcontainerstyle>         <style targettype="listboxitem">             <setter property="verticalcontentalignment" value="stretch"/>         </style>         </listbox.itemcontainerstyle>          <listbox.itemspanel>         <itemspaneltemplate>             <virtualizingstackpanel orientation="horizontal"/>         </itemspaneltemplate>         </listbox.itemspanel>          <listbox.itemtemplate>         <datatemplate>             <border borderbrush="black" borderthickness="0">             <grid width="{binding scenewidth}">                 <grid.rowdefinitions>                 <rowdefinition height="auto"/>                 <rowdefinition height="auto"/>                 <rowdefinition height="auto"/>                 <rowdefinition height="*"/>                 </grid.rowdefinitions>                  <!--contains item name , date-->                 <stackpanel grid.row="0">                 <textblock text="{binding itemname, fallbackvalue=item1}" margin="9,30,0,0" style="{staticresource phonetexttitle1style}" horizontalalignment="center"/>                 <textblock text="{binding currenttime, stringformat=d, fallbackvalue='sunday, may 11, 2014'}" style="{staticresource phonetextnormalstyle}" horizontalalignment="right"/>                 </stackpanel>              </grid>             </border>         </datatemplate>         </listbox.itemtemplate>     </listbox>     </scrollviewer> </grid> 


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -