Left mouse button while using ViewboxLimited - Printable Version
+- AB4D Forum (https://forum.ab4d.com)
+-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4)
+--- Forum: ZoomPanel (https://forum.ab4d.com/forumdisplay.php?fid=8)
+--- Thread: Left mouse button while using ViewboxLimited (/showthread.php?tid=3991)
Left mouse button while using ViewboxLimited - lloyd32552 - 11-25-2016
I have a situation where I use the left mouse button to select items on a canvas. The items can be very small so I also need zoom capabilities. The ViewboxLimited solution gives the perfect zoom capabilities but when when I select ZoomMode="Move" (or others), the MouseButtonLeftUp event no longer gets triggered so my selection no longer functions. I don't need the ability to move the canvas as the wheel gives all the control I need.
Do you have a suggestion?
Thanks again for all you do Andrej and for a great product.
RE: Left mouse button while using ViewboxLimited - abenedik - 11-25-2016
ZoomPanel also subscribes to MouseButtonLeftUp event and in case it is set to Move mode (or some other mode except None), it handles the event. This means that you will not get it.
But you can be notified about mouse event before ZoomPanel if you use PreviewMouse... events. In case of using Preview events, you need to set the Handled property of the MouseButtonEventArgs (get as parameter into event handler) to true in case when you handled the event by yourself - this means that the mouse down, up or some other event was used by your code and should not be used by some other subscriber - in this case ZoomPanel. This way, you can control which mouse down and up events are passed through ZoomPanel - those that are not handled by your code.
For example (taken from updates "ZoomToObjectSample"):
RE: Left mouse button while using ViewboxLimited - lloyd32552 - 11-26-2016