protected virtual object DropItem(object droppedItem, DropContext context) { if (this.Equals(droppedItem)) { return(droppedItem); } var theList = context.Data as System.Collections.IList; if (theList == null) { return(droppedItem); } if (theList.Contains(droppedItem)) { theList.Remove(droppedItem); } var thisIndex = theList.IndexOf(this); if (context.DropLocation == DropLocation.Before) { theList.Insert(thisIndex, droppedItem); } else { theList.Insert(thisIndex + 1, droppedItem); } return(droppedItem); }
protected override bool CanDropItem(object droppedItem, DropContext context) { if (base.CanDropItem(droppedItem, context)) { return(true); } return(droppedItem is IConvertible <AvailableGameViewModel>); }
protected override object DropItem(object droppedItem, DropContext context) { if (droppedItem is AvailableGameViewModel) { droppedItem = new ArenaGameViewModel(droppedItem as AvailableGameViewModel, this); } return(base.DropItem(droppedItem, context)); }
public bool CanDrop(IDragableSource source, DropContext context) { if (source == null) { return(false); } return(source.Items.All(droppedItem => CanDropItem(droppedItem, context))); }
protected override object DropItem(object droppedItem, DropContext context) { if (droppedItem is ILobbyItemSource) { return(base.DropItem(new LobbyItemViewModel(droppedItem as ILobbyItemSource), context)); } else { return(base.DropItem(droppedItem, context)); } }
protected override object DropItem(object droppedItem, DropContext context) { var convertible = droppedItem as IConvertible <AvailableGameViewModel>; if (convertible != null) { droppedItem = convertible.Convert(); } return(base.DropItem(droppedItem, context)); }
protected override bool CanDropItem(object droppedItem, DropContext context) { if (base.CanDropItem(droppedItem, context)) { return(true); } if (droppedItem is ILobbyItemSource) { return(true); } return(false); }
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))); }
protected virtual bool CanDropItem(object droppedItem, DropContext context) { var convertible = droppedItem as IConvertible <TItem>; if (typeof(TItem) != droppedItem.GetType() && convertible == null) { return(false); } if (convertible != null) { return(!this.Contains(convertible.Convert())); } return(!this.Contains((TItem)droppedItem)); }
protected override bool CanDropItem(object droppedItem, DropContext context) { if (base.CanDropItem(droppedItem, context)) { return(true); } var lobbyItemSource = droppedItem as ILobbyItemSource; if (lobbyItemSource == null) { return(false); } return(!this.Any(item => item.Id == lobbyItemSource.Id)); }
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)); }
protected virtual object DropItem(object droppedItem, DropContext context) { var convertible = droppedItem as IConvertible <TItem>; TItem item; if (convertible != null) { item = convertible.Convert(); } else { item = (TItem)droppedItem; } if (!this.Contains(item)) { this.Add(item); } return(item); }
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)); }
protected virtual bool CanDropItem(object droppedItem, DropContext context) { return(this.GetType().Equals(droppedItem.GetType())); }
DropResult IDropable.Drop(IDragableSource source, DropContext context) { return(Games.Drop(source, context)); }