Пример #1
0
        protected override void OnDrop(DragEventArgs e)
        {
            CategoryItemViewModel dragSource;
            CategoryItemViewModel dropTarget;

            if (IsValidDropTarget(e, out dragSource, out dropTarget))
            {
                switch (GetDropAction(e, dropTarget))
                {
                case DropActionEnum.InsertBefore:
                    ViewModelLocator.Locator.DragDrop.InsertBefore(dragSource, dropTarget);
                    break;

                case DropActionEnum.Add:
                    ViewModelLocator.Locator.DragDrop.Add(dragSource, dropTarget);
                    break;

                case DropActionEnum.InsertAfter:
                    ViewModelLocator.Locator.DragDrop.InsertAfter(dragSource, dropTarget);
                    break;
                }
            }

            DropAction = DropActionEnum.None;

            e.Handled = true;
        }
Пример #2
0
        protected override void OnDragOver(DragEventArgs e)
        {
            CategoryItemViewModel dragSource;
            CategoryItemViewModel dropTarget;

            if (IsValidDropTarget(e, out dragSource, out dropTarget))
            {
                DropAction = GetDropAction(e, dropTarget);
            }

            e.Handled = true;
        }
Пример #3
0
        protected override void OnDragLeave(DragEventArgs e)
        {
            DropAction = DropActionEnum.None;

            e.Handled = true;
        }