Esempio n. 1
0
        void AssociatedObject_DragEnter(object sender, DragEventArgs e)
        {
            e.Effects = _effect = DragDropEffects.None;
            Type dataType = GetDataType(e);

            if (dataType != null)
            {
                //Debug.WriteLine("Timer START");
                _openTimer.Start();

                // can drop?
                IDropable dropable = GetDropable();
                _canDrop   = dropable.CanDrop(GetData(e), this.AssociatedObject.DataContext, out _message);
                _data      = GetData(e);
                _target    = this.AssociatedObject.DataContext;
                _uiElement = sender as UIElement;

                if (_adorner == null)
                {
                    MakeAdorner(_uiElement, _data, _target, false, _canDrop, _message);
                }

                // give mouse effect
                if (_canDrop)
                {
                    e.Effects = _effect = DragDropEffects.Move;
                }
            }
            e.Handled = true;
        }