void UserControl1_MouseMove(object sender, MouseEventArgs e) { if(e.LeftButton==MouseButtonState .Pressed) DragDrop .DoDragDrop(this ,new DataObject("myformat",this),DragDropEffects .Move ); } void UserControl2_MouseMove(object sender, MouseEventArgs e) { if(e.LeftButton==MouseButtonState .Pressed) DragDrop .DoDragDrop(this ,new DataObject("myformat",this),DragDropEffects .Move ); } void Canvas1_Drop(object sender, DragEventArgs e) { var control=e.Data .GetData(typeof(UserControl))as UserControl; canvas1 .Children .Add(control); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)