I try another solution too, with the event PreviewMouseMove of each node.
The method which create my node :
private void CreateNode(object obj, ref ShapeNode node) {
node.Text = obj.ToString();
node.TextFormat.LineAlignment = StringAlignment.Center;
node.Tag = obj;
node.Shape = this.CreateShape(obj.ToString());
node.Font.Size = 9.0;
node.ToolTip = obj.ToString();
node.Brush = Brushes.Transparent;
node.Pen = new Pen(Brushes.Black, 1.0);
node.PreviewMouseMove += new MouseEventHandler(node_MouseMove);
#region Pour gérer le double clic sur un ShapeNode
MouseGesture OpenCmdMouseGesture = new MouseGesture();
OpenCmdMouseGesture.MouseAction = MouseAction.LeftDoubleClick;
MouseBinding OpenCmdMouseBinding = new MouseBinding();
OpenCmdMouseBinding.Gesture = OpenCmdMouseGesture;
OpenCmdMouseBinding.Command = this.DoubleClickCommand;
node.InputBindings.Add(OpenCmdMouseBinding);
#endregion
#region Pour gérer le simple click sur un ShapeNode
OpenCmdMouseGesture = new MouseGesture();
OpenCmdMouseGesture.MouseAction = MouseAction.LeftClick;
OpenCmdMouseBinding = new MouseBinding();
OpenCmdMouseBinding.Gesture = OpenCmdMouseGesture;
OpenCmdMouseBinding.Command = this.ClickCommand;
node.InputBindings.Add(OpenCmdMouseBinding);
#endregion
node.AnchorPattern = new AnchorPattern(
new AnchorPoint[] {
new AnchorPoint(0, 50, true, false),
new AnchorPoint(50, 100, false, true),
new AnchorPoint(100, 50, false, true)
}
);
// on ne veut pas voir les points d'accroches
node.EnabledHandles = AdjustmentHandles.None;
node.HandlesStyle = HandlesStyle.Invisible;
// pour empécher le tracé de lien entre ShapeNode
node.Locked = true;
}
As you can see, I add an InputBindings to the node for the MouseAction.LeftClick.
Without this InputBindings, all I have is the selection rectangle and the drag & drop don't work.
With this InputBindings, I can drag & drop in my ListBox, but the diagram don't understand that I succed my drag & drop when I come back over the diagram. Maybe due to the selection rectangle...

Maybe this is not the good solution, so if you have got any sample.
Thanks.