Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] SwipeGestureRecognizer: Enable progressive tracking #13285

@Elashi

Description

@Elashi

Summary

Allow user to handle progressive tracking in SwipeGestureRecognizer just like PanGestureRecognizer . This way I can show some animation during swipe operation before it is complete. Currently its command is only called upon completion.

API Changes

All what needs to be done to provide the requested feature is in the file SwipeGestureRecognizer. Just add one event OnDetectSwipe and trigger it in DetectSwipe. So simple change yet provides a lot.

Here is how the event is going to be used:

	var swipeGesture = new SwipeGestureRecognizer();
	swipeGesture.PanUpdated += OnDetectSwipe;
	GestureRecognizers.Add(swipeGesture);
}

private void OnDetectSwipe(object sender, DetectSwipeUpdatedEventArgs e)
{
	switch (e.StatusType)
	{
		case GestureStatus.Running:
			Content.TranslationX = _x + e.TotalX;
			// Content.TranslationY =_y + e.TotalY;
			break;
		case GestureStatus.Completed:
			break;
	}
}

Intended Use Case

I would like to create my own slide menu just like shell Flyout. During swipe, it feels as if you drag it from the side of the window to its final position.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions