0

I wonder how I could able to call MMap_MarkerClick from MMap_InfoWindowClick?

private void MMap_InfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
{
     //call MMap_MarkerClick

}

private void MMap_MarkerClick(object sender, GoogleMap.MarkerClickEventArgs e)
{
   ViewModel.MapMarkerSelected(e.Marker.Title);
}

I am trying to achive it, because MMap_InfoWindowClick does not open new ViewModel, but MMap_MarkerClick does. MarkerClick works but InfoWindowClick does not open ViewModel

Community
  • 1
  • 1
casillas
  • 16,351
  • 19
  • 115
  • 215
  • you can just call "MMap_MarkerClick(sender, null);" but somehow I doubt this addresses your underlying issue. – Jason Mar 13 '17 at 22:14
  • @Jason, but if I send null, how could able to get `e.Marker.Title`? – casillas Mar 13 '17 at 22:21
  • construct a new MarkerClickEventArgs and pass it in. Or just call ViewModel.MapMarkerSelected directly from InfoWindowClick? – Jason Mar 13 '17 at 22:28
  • even though I call it, it still same issue, cannot able to open the `ViewModel`, it does not underlying my issue. – casillas Mar 13 '17 at 22:31
  • what do you mean by "open ViewModel"? A ViewModel is just a class, what are you expecting to happen? – Jason Mar 13 '17 at 22:41
  • @Jason I am referring to my linked (previous) question. `ShowViewModel` actually opens a `View` in `MVVMCross`. It opens when I use `MarkerClick`, but it does not when I use `InfoWindowClick` – casillas Mar 13 '17 at 22:43
  • this question is not tagged MVVMCross – Jason Mar 13 '17 at 22:46
  • @Jason, I have added the tag. – casillas Mar 14 '17 at 00:12

0 Answers0