the WPF Popup control is nice, but somewhat limited in my opinion. is there a way to \"drag\" a popup around when it is opened (like with the DragMove() method of windows)?<
Here's a simple solution using a Thumb.
XAML:
C#:
public partial class DraggablePopup : Popup
{
public DraggablePopup()
{
var thumb = new Thumb
{
Width = 0,
Height = 0,
};
ContentCanvas.Children.Add(thumb);
MouseDown += (sender, e) =>
{
thumb.RaiseEvent(e);
};
thumb.DragDelta += (sender, e) =>
{
HorizontalOffset += e.HorizontalChange;
VerticalOffset += e.VerticalChange;
};
}
}