How to make sure the user can move images to other position

Khos 1 Reputation point

hi all,

I have a page where the user can upload a bunch of images. When the images are uploaded I want to make sure the user can move the images to change the position of it. Has anyone an idea how I can implement this feature? It would help a lot.

Thanks a lot.

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
4,919 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,866 Reputation points


    Welcome to our Microsoft Q&A platform!

    For this function, try adding drag and drop gesture recognizers to the Images to change the position. Enable the AllowDrop property and CanDrag property to make the Image can be a drop target and a drag source.

    Check the code:

       <Grid ...>  
           <Image Grid.Column="0" HeightRequest="300" WidthRequest="250">  
                   <DropGestureRecognizer AllowDrop="True"/>  
                   <DragGestureRecognizer CanDrag="True" />  
           <Image Grid.Column="1" HeightRequest="300" WidthRequest="250">  
                   <DropGestureRecognizer AllowDrop="True"/>  
                   <DragGestureRecognizer CanDrag="True" />  

    Check the tutorial:
    Sample code you could refer to:

    Best Regards,

    Jarvan Zhang

    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.