示例#1
0
        private void AssociatedObjectOnDrop(object sender, DragEventArgs dragEventArgs)
        {
            if (_dataType != null)
            {
                if (dragEventArgs.Data.GetDataPresent(_dataType))
                {
                    IDropable target = this.AssociatedObject.DataContext as IDropable;
                    if (target != null)
                    {
                        IDragable source = dragEventArgs.Data.GetData(_dataType) as IDragable;
                        if (source != null)
                        {
                            Debug.WriteLine("Drop");
                            Point currentPosition = dragEventArgs.GetPosition(RelativeElement);
                            source.Update(currentPosition.X, currentPosition.Y);
                        }

                        //target.Drop(dragEventArgs.Data.GetData(_dataType));
                    }
                }
            }

            dragEventArgs.Handled = true;
        }