I'm using a map in a map control as a secondary map in a pro window. I've tried to use the MouseWheel event and the PreviewMouseWheel event. Neither gets triggered. How should I be using these events? I didn't find anything in the two samples that are normally given for MapControl (overview and magnifier). I'm creating a new map and adding layers which are then used to create the ViewContent for the MapControl. MapView.Active never points to the MapControl even when I'm using the MapControl map, so those options are not available..
I can get the mouse move event, but not the mouse left button down or mouse hweel. This includes the preview.
I'm currently still using version 3.0.3.
Solved! Go to Solution.
This is not currently supported. Thank u for the requirement. We will look into adding event subscription for the control at 3.4.
This is not currently supported. Thank u for the requirement. We will look into adding event subscription for the control at 3.4.
Thank you for looking into this. Since the documentation includes mouse events for the map control it's a bit confusing as to what is actually supported.
can u point me to the incorrect documentation please? I did a quick scan of https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Map-Exploration#mapcontrol but didnt see a reference to Mouse events....I wld like to correct it.
fyi: perhaps because u r "seeing" the inherited events from the base WPF UIElement class on the api reference? https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic12547.html#EventsBookmark
If u uncheck "Include Inherited Members" u will see only the events implemented on the map control itself
That was it. thank you. I did get the mouse enter event to work, but none of the others.
I am using version 3.4, but the mouse events are not being triggered. I have tried using the MouseWheel event, the PreviewMouseWheel event, and other mouse events, but none of them are triggered. However, events like MouseMove, MouseEnter, and MouseLeave are triggered.
I am working on a dockpane that displays a map using the MapControl with the ViewContent method, and I have added layers to the map.
This is how i am subscribing to an event
this.MapControls.PreviewMouseWheel += MapControls_PreviewMouseWheel;
And here is the event handler:
private void MapControls_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
MessageBox.Show("MapControls_PreviewMouseWheel intercepted!");
e.Handled = true; // Disable default zoom
}