wpfgesturerecognizer icon indicating copy to clipboard operation
wpfgesturerecognizer copied to clipboard

Manipulation during gesture

Open erodewald opened this issue 8 years ago • 3 comments

Hopefully this is not outside the scope of the project. In my mind, this project should support manipulation of the element capturing the gesture. I think most, if not all usage scenarios of this project are using it for scrolling or moving an element. Paging between views, scrolling through a list of items, etc. The problem with this library is that it provides no feedback until the gesture has completed.

Consider how most Android ROMs do paging. Manipulation occurs in real-time, letting go past a threshold will advance to the next page, but also a strong swipe gesture will advance it as well. The net result is the same with this project, but the user experience that people are conditioned to understand is just not there.

Any ideas on how to include that?

erodewald avatar Mar 01 '16 18:03 erodewald

Hi gen3ric,

I understand your point of view related to paging, that represents the creation of several new controls which host the views you want to present to the user; and I do agree the recogniser should be able to provide feedback as the gesture is being performed, which is something I will be working soon. Guess people can take it from there to expand it in different directions.

The gesture for scroll is already implemented in WPF on the ScrollView control via its panning properties. I use this a lot lately.

Moving an element (drag and drop) is a manipulation in which different controls can react differently (reason why I haven't implemented as a public library) and its outcome depends mainly on the target control and its properties. In fact, the way I detect a gesture is by monitoring the manipulation events and determine what was requested based on deltas.

Paging elements the same way android does it can be achieved with Pivot Control as those are available for universal apps. The problem in .net is that the API lacks of accessibility for the implementation of some of these features and everything seems to be developed for universal apps... there is a way to bridge core functionality implemented on .net to universal apps and is discussed here.

rodrigoelp avatar Mar 04 '16 08:03 rodrigoelp

Hi there, thanks for responding.

I implemented a fairly basic implementation that satisfied my needs. I can submit a PR, you can take what you need from it if it helps you at all!

I ended handling intertial translation/rotation/zoom on arbitrary UIElement and simple offset translation for the ScrollViewer. I can think of a few scenarios I didn't handle, but it is a good start. It's unfortunate that WPF's support for touch controls is so lacking but I am glad you're helping to change that.

erodewald avatar Mar 04 '16 15:03 erodewald

Hi gen3ric, I will be reviewing your code starting on Monday (that way I can test it with some of my devices at the office). Thanks for the effort.

rodrigoelp avatar Mar 05 '16 02:03 rodrigoelp