AnsweredAssumed Answered

how to do a hittest in mvvm patten

Question asked by JohnWoon on May 19, 2015
Latest reply on May 20, 2015 by JohnWoon

Hi all,


I'm trying to separate MapView and Map. Following the guide "Use the MVVM design pattern—ArcGIS Runtime SDK for .NET | ArcGIS for Developers ".

But it seems unable to a hittest in the viewmodel, because the viewmodel have no reference to the MapView and the hittest method need a MapView  as a parameter.

I implemented a EventToCommand trigger to bind the MapViewTapped event to a RelyCommand, using the mvvm light toolkit library provided by MVVM Light Toolkit  .

I could get the EventArgs (Esri.ArcGISRuntime.Controls.MapViewInputEventArgs), but not the sender which should be the instance of the MapView control.

Hope somebody show me a better solution, thanks in advance.