How to disable scrolling between FlipView items with mouse wheel on Windows 8.1 -
i have windows 8.1 store c#/xaml app, in app have flipview several flipview items. in 1 item have webview quite long.
problem - when scroll using mouse wheel in webview , reach end of page, the flipview scrolls next item, unwanted.
the expected behavior freely scroll within webview , not between flipview items. ideally switching between flipview items should work using touch or programmatic change.
i've tried setting different scrollviewer properties on flipviewitem or nested items, changining manipulationmode, nothing worked far.
sample code:
<flipview> <flipviewitem> <grid background="red"/> </flipviewitem> <flipviewitem> <grid> <!-- when scrolling on page, not navigate blue or red flipviewitem--> <webview source="http://cnn.com"/> </grid> </flipviewitem> <flipviewitem> <grid background="blue"/> </flipviewitem> </flipview>
found after trying scrollviewer attached properties on elements around, solution simple - tamás deme hinted need handle pointerwheelchanged event on parent element containing webview.
<flipview> <flipviewitem> <grid background="red"/> </flipviewitem> <flipviewitem> <grid pointerwheelchanged="pointerwheelignore"> <webview source="http://cnn.com"/> </grid> </flipviewitem> <flipviewitem> <grid background="blue"/> </flipviewitem> </flipview> ... private void pointerwheelignore(object sender, pointerroutedeventargs e) { e.handled = true; } why works? webview translating mouse wheel scrolling events move web content around , setting pointerroutedeventargs handled. if web content @ bottom, webview not setting pointerroutedeventargs handled , this event bubbles flipview flips between flipviewitems. if handle/stop pointerwheelchanged event between webview , flipview, there no flipview scrolling between items.
Comments
Post a Comment