Mymapview.Mousewheel event doesn't trigger

533
1
03-20-2018 03:50 PM
BikeshMaharjan1
New Contributor III

I am trying to call a method when user scrolls mouse wheel on the map but it doesn't. Here is what I tried:

In Xaml:

<esri:MapView MouseWheel="MyMapView_MouseWheel">

That didn't work so:

I tried to subscribe it in the code behind:

MyMapView.MouseWheel += MyMapView_MouseWheel;

It still doesn't trigger the method. However, PreviewMouseWheel works.

Any help appreciated!

Thanks!

0 Kudos
1 Reply
dotMorten_esri
Esri Frequent Contributor

This is intended behavior. The MapView uses the scroll event to perform a zoom operation and therefore the event doesn't bubble up. If it did and for instance put the MapView inside a scrollviewer, the map would both zoom and the page scroll at the same time.

If you disable zoom on the map view (use the InteractionOptions property), the MapView won't intercept the event and let the event bubble up.

0 Kudos