c# - Stop scrolling with current offset in windows phone -
am having problem in scrollviewer. scenario:
am having stack panel inside having content, mouse move of content showing popup rearrange content.
issue: when trying handle mouse move of content popup shows , scrolling happening.
expected behavior: scrolling should not happen while handling mouse move.
i have tried "horizontalscrollbarvisibility = scrollbarvisibility.disabled" works fine sets scrollviewer initial position, means horizontal offset sets zero("0")
thanks in advance.
as per our discussion, think best route store class level boolean determine whether or not enable scrolling. you'd have set according needs (probably same place modifying visibility before).
the next step set events , properties on scrollviewer can control whether scrolls or not. need modify constructor of page holding scrollviewer, , create handler manipulationstarted event. following assumes control named scroll, , variable locked set true when control should not scroll:
public mainwindow() { initializecomponent(); scroller.manipulationstarted += new eventhandler<manipulationstartedeventargs>(scroller_manipulationstarted); scroller.manipulationmode = manipulationmode.control; // required } void scroller_manipulationstarted(object sender, manipulationstartedeventargs e) { if (locked) { e.handled = true; e.complete(); } }
Comments
Post a Comment