c# - Scroll item to center with VirtualizingStackPanel in Windows 8 Metro -


i'm working on windows 8 metro app , have gridview few hundred items different widths displayed. i'm using virtualizingstackpanel improve memory consumption. need scroll item center of gridview. using gridview.scrollintoview or virtualizingstackpanel.sethorizontaloffset scroll item edge of screen, not center.

this post discusses similar issue on wpf side. problem a) won't compile metro app few of objects don't exist , b) implementation logical scrolling seems dependent on items being equal width.

what best solution problem? there available in framework make straightforward?

scrollintoview works, need call this:

await dispatcher.runasync(coredispatcherpriority.low,                         () => { this.gridview.scrollintoview(youritem); }); 

Comments