PanningTool instead of click

I have a problem with one control I use as the visualization of a node.
If I click on this I would expect that I can move the control (as it is on a Slider Control). But instead the PanningTool is activated and I move the diagram.
Just for Info the Control is a CircularGaugeControl which I use as a Rotaryknob.

Any hint?

I don’t know. How is your CircularGaugeControl fundamentally different from a ScrollBar?

Run the Entity Relationship (ER Diagram) sample, and resize a node to be smaller. You’ll see scrollbars, and a mouse drag on their thumbs will scroll, not select the node or pan the diagram.

No, no,
it has nothing todo with resizing a node.
See this little video I made (by the way - it would be nice to upload such thing to the forum).

Little Video

No, I understand that the issue has nothing to do with resizing. I was just suggesting a way of producing a slider-like control, embedded in a Node, in an existing sample, that the user should be able to drag in order to modify some value.

And that dragging the scrollbar’s thumb in the node does not cause the whole diagram to pan or scroll.

Not knowing anything about your CircularGaugeControl, it seems to me that it isn’t setting RoutedEventArgs.Handled to true.

I think you’re right.
I have to write another support request to the DevExpress people.

If there is no response, can I do something like making a CustomPanningTool where I set CanStart to false if the mouse is over a Node?

Yes, override CanStart to:

return base.CanStart() && Diagram.Panel.FindPartAt(Diagram.LastMousePointInModel, null, SearchLayers.Nodes) == null;

I hope I don’t have any typos there.

Hi Walter,
thank you for the code. It seems to work, but if I move the mouse of the rotaryknob the diagram still captures mouse and do the pan.

See the video. I click on the Rotaryknob (I already build a own usercontrol to handle CaptureMouse und ReleaseMouseCapture on MouseDown and MouseUp), holding down the MouseButton I leave the knob and suddenly the diagram gets in control.


Sorry, I can’t help you there – you’ll need to debug that CircularGaugeControl code yourself.

Ok I understand that, but if I use this rotaryknob on a normal Window instead on a diagram it worked as expected.

OK, but are the circumstances the same? How did you implement panning in your normal Window?