Scroll diagram by mouse

Hello,
is there a possibility to scroll the diagram with right-mouseButton down, like in googlemaps?

When I try http://maps.google.com, right mouse down brings up a context menu. It does not do panning.

So what do you want to have happen?

Perhaps you want to customize the PanningTool.CanStart method?

hello Walter,
i want to scroll the diagram with mouse right-click, like i can do it in googlemaps with left-click, because left click in a diagram has a function already

You can adapt the code in panning-with-mouse-middle-button.

Okay, i can move the diagram but only when i hold the mousebutton down on a node. Is there a way to move the diagram when clicking anywhere in the diagram?

OK, forget about customized tools – just implement a Diagram.MouseRightButtonUp event handler.

Call MouseButtonEventArgs.GetPosition(myDiagram.Panel) and convert the Point into model coordinates by calling myDiagram.Panel.TransformViewToModel. Calculate the offset that you want and then adjust myDiagram.Panel.Position accordingly.

Okay, thanks for this tip, i will try it.