public static void DoDragDrop(DependencyObject dragSource, object data, CustomDragDropEffects allowedEffects, CustomDragDropKeyStates initialKeyState) { _dragOperationInProgress = new CustomDragOperation(dragSource, data, allowedEffects, initialKeyState); _dragOperationInProgress.Subscribe<CustomDragDropEffects>(delegate (CustomDragDropEffects effects) { CustomDragDropCompletedEventArgs args = new CustomDragDropCompletedEventArgs { Effects = effects }; OnDragCompleted(args); }); }
private static void OnDragCompleted(CustomDragDropCompletedEventArgs args) { _dragOperationInProgress.Dispose(); _dragOperationInProgress = null; EventHandler<CustomDragDropCompletedEventArgs> dragDropCompleted = DragDropCompleted; if (dragDropCompleted != null) { dragDropCompleted(null, args); } }