コード例 #1
0
 public void SetPayload(IDnDContainer <TItem> parent, int indexInParent, IDnDElement <TItem> wrappingElement)
 {
     Payload = new DnDPayload <TItem>()
     {
         Parent          = parent,
         IndexInParent   = indexInParent,
         WrappingElement = wrappingElement
     };
     NotifyStateChanged();
 }
コード例 #2
0
 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();
 }
コード例 #3
0
        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;