Cant capture MouseUp of left button on childen of zoom panel
#2
When ZoomPanel is active, it captures the mouse events to handle zooming and panning.

To get left button events you need to deactivate the ZoomPanel by setting its ZoomMode to None. If you are using ZoomController this mode is set when the current mode is deactivated - for example if currently move mode is activated (the first button) than the ZoomMode is set to None when the user clicks again on Move button.

To see more details about how to do this please see the PainterSample that comes with ZoomPanel - it is using mouse events on the Canvas inside ZoomPanel to draw on the canvas with the mouse.

If you do not want to put the ZoomPanel's ZoomMode to None, you can subscribe to PreviewMouseLeftButtonDown, PreviewMouseLeftButtonUp, etc. events and get the events before ZoomPanel will get them. In the handler you can can decide if you want to process the event by yourself or pass it to ZoomPanel. If you handle the event by yourself, than set the e.Handled in the EventArgs to true to prevent passing the event further to ZoomPanel.

A similar approach (using Preview mouse events) is used in the Multi mouse buttons sample that comes with ZoomPanel.

When ZoomMode on ZoomPanel is not set to None
Andrej Benedik
  


Messages In This Thread
RE: Cant capture MouseUp of left button on childen of zoom panel - by abenedik - 11-08-2011, 09:58 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)