public UIDropProposal SessionDidUpdate(UIDropInteraction interaction, IUIDropSession session) { UIDropOperation operation = UIDropOperation.Cancel; if (session.LocalDragSession == null) { return(new UIDropProposal(operation)); } if (interaction.View is IVisualElementRenderer renderer) { DataPackage package = null; if (session.LocalDragSession.Items.Length > 0 && session.LocalDragSession.Items[0].LocalObject is CustomLocalStateData cdi) { package = cdi.DataPackage; } if (HandleDragOver((View)renderer.Element, package)) { operation = UIDropOperation.Copy; } } return(new UIDropProposal(operation)); }
public UIDropProposal SessionDidUpdate(UIDropInteraction interaction, IUIDropSession session) { var dropLocation = session.LocationInView(View); UpdateLayers(dropLocation); var operation = new UIDropOperation(); if (ImageView.Frame.Contains(dropLocation)) { operation = session.LocalDragSession == null ? UIDropOperation.Copy : UIDropOperation.Move; } else { // Cancel dropping if it's not inside the image view. operation = UIDropOperation.Cancel; } return(new UIDropProposal(operation)); }
public UIDropProposal SessionDidUpdate(UIDropInteraction interaction, IUIDropSession session) { UIDropOperation operation = UIDropOperation.Cancel; if (session.LocalDragSession == null) { return(new UIDropProposal(operation)); } DataPackage package = null; if (session.LocalDragSession.Items.Length > 0 && session.LocalDragSession.Items[0].LocalObject is CustomLocalStateData cdi) { package = cdi.DataPackage; } if (HandleDragOver((View)_viewHandler.VirtualView, package)) { operation = UIDropOperation.Copy; } return(new UIDropProposal(operation)); }
public void SessionDidEnd(UIDragInteraction interaction, IUIDragSession session, UIDropOperation operation) { Alpha = 1f; }
public void SessionWillEnd(UIDragInteraction interaction, IUIDragSession session, UIDropOperation operation) { if (operation == UIDropOperation.Copy) { FadeItems(session.Items, 1f); } }
public void SessionWillEnd(UIDragInteraction interaction, IUIDragSession session, UIDropOperation operation) { if ((operation == UIDropOperation.Cancel || operation == UIDropOperation.Forbidden) && session.Items.Length > 0 && session.Items[0].LocalObject is CustomLocalStateData cdi) { this.HandleDropCompleted(cdi.View); } }