|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Documents;
using System.Windows;
using System.Windows.Media;
namespace GongSolutions.Wpf.DragDrop
{
public abstract class DropTargetAdorner : Adorner
{
public DropTargetAdorner(UIElement adornedElement)
: base(adornedElement)
{
m_AdornerLayer = AdornerLayer.GetAdornerLayer(adornedElement);
m_AdornerLayer.Add(this);
IsHitTestVisible = false;
}
public void Detatch()
{
m_AdornerLayer.Remove(this);
}
public DropInfo DropInfo { get; set; }
internal static DropTargetAdorner Create(Type type, UIElement adornedElement)
{
if (!typeof(DropTargetAdorner).IsAssignableFrom(type))
{
throw new InvalidOperationException(
"The requested adorner class does not derive from DropTargetAdorner.");
}
return (DropTargetAdorner)type.GetConstructor(new[] { typeof(UIElement) })
.Invoke(new[] { adornedElement });
}
AdornerLayer m_AdornerLayer;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.