dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.95k stars 1.7k forks source link

DragGestureRecognizer should allow to point to another view as placeholder view #13596

Open unamed000 opened 1 year ago

unamed000 commented 1 year ago

Description

When i use DragGestureRecognizer on Xamarin.Forms, it will automatically get the view that i bound the DragGestureRecognizer on as a placeholder view when user long click on it and start moving their finger.

The problem is not every scenario we always want the user interact with the entire view. Sometimes, they can only drag and drop on an icon (for avoiding conflicting gestures on the entire view).

But if we implement the DragGestureRecognizer on that Icon/Image only, we can only see the placeholder as the Icon/Imagge

Therefore, I think it's great to have a feature that telling Xamarin before creating the placeholder pointing to another view instead of the view it's bounding to.

Public API Changes

On DragStartingEventArgs from DragStarting of the GestureRecognizer, we should have a property like

    public class DragStartingEventArgs : EventArgs
    {
        public DragStartingEventArgs()
        {
            Data = new DataPackage();
        }

        public bool Handled { get; set; }
        public bool Cancel { get; set; }
        public DataPackage Data { get; private set; }
                public VisualElement PlaceholderView { get; set; } // we can set this property when DragStarting invoked
    }

Intended Use-Case

Use case mentioned in Description

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.