Halt / stop a ScrollViewer from scrolling when using a FlipView
Asked Answered
R

0

0

Moving on from this question where I wanted to fire an event when a FlipView changed even if manipulations wren't complete.

I have VerticalSnapPointsType set to SnapPointsType.MandatorySingle and once the event, from the initial question, fires, I'd like to halt scrolling. Currently the event fires every time the FlipView is changed but right when the animation stops, the user can flip again, even if I set IsHitTestVisible to false. If I CancelDirectManipulations() I get the desired effect but I don't think canceling manipulations was indented for this as scrolling seems to be disabled after its executed.

At a high level I'd like to:

  1. Fire an event each time the user flips.
  2. Halt scrolling and set IsHitTestVisible to false
  3. Do stuff based on user changing flipview
  4. Set IsHitTestVisible back to true so the user can flip it again

I'm trying to mimic the behavior of the music player on WP. Some of the music a user will flip to may be streamed so, like a transaction, I need to control the FlipView so I can coordinate with the background agent.

Ricketts answered 21/12, 2014 at 16:56 Comment(7)
How about managing the items in the FlipView? If you don't want the user to be able to flip again, just don't add more items. Put the "next" item in the FlipView only after you're ready with the "stuff".Folio
I'd lose the "preview" functionality then.Ricketts
How so? From what I understand, you want to disable flipping, do something and then enable it. What I suggested can be used to do that, no?Folio
The FlipView lets the user preview the next item before selecting it. So if there is only 1 item populated at a time, I don't think the user would see the prev and next when they start sliding the view before the selected item changed.Ricketts
Aren't "previewing" and "selecting" it the same thing? Also, the idea is to start with two items, and allow the user to switch to the second one. Then, once you're ready, add a third one, and so on. Something like this.Folio
I don't think they're the same, you can slide the flipview up or down and see the next/prev item and then drop it or slide it back and not change the selected item. It's worth trying though.Ricketts
Let us continue this discussion in chat.Folio

© 2022 - 2024 — McMap. All rights reserved.