public bool CanDrop(IDragableSource source, DropContext context) { if (source == null) { return(false); } return(source.Items.All(droppedItem => CanDropItem(droppedItem, context))); }
public bool CanDrop(IDragableSource source, DropContext context) { if (source == null) { return(false); } if (!(context.Data is System.Collections.IList)) { return(false); } return(source.Items.All(item => CanDropItem(item, context))); }
public DropResult Drop(IDragableSource source, DropContext context) { if (!CanDrop(source, context)) { return(new DropResult()); } var finalItems = new List <object>(); foreach (var droppedItem in source.Items) { finalItems.Add(DropItem(droppedItem, context)); } return(new DropResult(finalItems)); }
public DropResult Drop(IDragableSource source, DropContext context) { if (!CanDrop(source, context)) { return(new DropResult()); } var resultItems = new List <object>(); foreach (object item in source.Items) { var finalItem = DropItem(item, context); if (finalItem != null) { resultItems.Add(finalItem); } } return(new DropResult(resultItems)); }
void AssociatedObject_MouseLeave(object sender, MouseEventArgs e) { try { if (isMouseClicked) { //set the item's DataContext as the data to be transferred IDragableSource dragObject = this.AssociatedObject.DataContext as IDragableSource; if (dragObject != null) { DataObject data = new DataObject(); data.SetData(typeof(IDragableSource), dragObject); System.Windows.DragDrop.DoDragDrop(this.AssociatedObject, data, DragDropEffects.Move); } } isMouseClicked = false; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } }
DropResult IDropable.Drop(IDragableSource source, DropContext context) { return(Games.Drop(source, context)); }
bool IDropable.CanDrop(IDragableSource source, DropContext context) { return(Games.CanDrop(source, context)); }
bool IDropable.CanDrop(IDragableSource source, DropContext context) { return(this.Items.CanDrop(source, context)); }