Ejemplo n.º 1
0
        private void OnHostDragEnter(object sender, DragEventArgs e)
        {
            var src  = new DragEventSource(_fakePointerId, e);
            var data = ToDataPackage(e.Data);
            var allowedOperations = ToDataPackageOperation(e.AllowedEffects);
            var info = new CoreDragInfo(src, data.GetView(), allowedOperations);

            CoreDragDropManager.GetForCurrentView()?.DragStarted(info);

            // Note: No needs to _manager.ProcessMove, the DragStarted will actually have the same effect
        }
Ejemplo n.º 2
0
        private NSDragOperation OnDraggingEnteredEvent(NSDraggingInfo draggingInfo)
        {
            var source            = new DragEventSource(_fakePointerId, draggingInfo, _window);
            var data              = DataPackage.CreateFromNativeDragDropData(draggingInfo);
            var allowedOperations = DataPackageOperation.Copy;             // Should match with return value
            var info              = new CoreDragInfo(source, data, allowedOperations);

            CoreDragDropManager.GetForCurrentView()?.DragStarted(info);

            // Note: No need to _manager.ProcessMove, the DragStarted will actually have the same effect

            // To allow the macOS drag to continue, we must assume drop is supported here.
            // This will immediately be updated within the OnDraggingUpdated method.
            return(NSDragOperation.Copy);
        }