public void SetPayload(IDnDContainer <TItem> parent, int indexInParent, IDnDElement <TItem> wrappingElement) { Payload = new DnDPayload <TItem>() { Parent = parent, IndexInParent = indexInParent, WrappingElement = wrappingElement }; NotifyStateChanged(); }
public void SetTarget(IDnDContainer <TItem> parent, int indexInParent, IDnDElement <TItem> wrappingElement, bool isDropFirst = true) { Target = new DnDPayload <TItem>() { Parent = parent, IndexInParent = indexInParent, WrappingElement = wrappingElement, GroupAsFirst = isDropFirst }; NotifyStateChanged(); }
public void ShowNewItem(IDnDContainer <TItem> parent, int indexInParent, IDnDElement <TItem> wrappingElement) { NewItemPayload = new DnDPayload <TItem>() { Parent = parent, IndexInParent = indexInParent, WrappingElement = wrappingElement }; // TODO: Need to figure out how to add a new item when we are not supplying a parent var parentObj = parent is null || parent == BaseContainer ? default : parent.Parent.Children[parent.IndexInParent]; NewItem = BaseContainer.NewItemMethod is { } ? BaseContainer.NewItemMethod.Invoke(parentObj) : default;