0

I am trying to add a custom click on the InfoWindow, but it does not work. I wonder what I am doing wrong?

InfoWindow.axml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clickable="true"
    android:id="@+id/infoLayout"/>

View.cs

 mMap.SetInfoWindowAdapter(this);

 public View GetInfoWindow(Marker marker)
 {
     View view = this.BindingInflate(Resource.Layout.InfoWindow, null, false); 
     LinearLayout infoWindow = view.FindViewById<LinearLayout>(Resource.Id.infoLayout);
     infoWindow.Click += delegate {
         ViewModel.MapMarkerSelected(marker.Title);
      };
     return view;
 }

Whenever I click on the Marker not even the custom InfoWindow, I keeps getting the following output

(HTTPLog)-Static: isSBSettingEnabled false

Whenever I click on the custom Info Window, I keep getting the following output, it does not do anything and I see the following on the output screen

(HTTPLog)-Static: isSBSettingEnabled false

D/ViewRootImpl(24699) ViewPostImeInputStage processPointer 0

D/ViewRootImpl(24699)ViewPostImeInputStage processPointer 1


NOTE:

Even though, this question has just been marked as a [duplicate] but it is not [duplicate] for sure. I think the guy who has marked it as [duplicate] has neither read the question thoroughly nor any development knowledge on the Xamarin platform. Anyway, I am going to contact the customer service and raise a ticket for that.

Community
  • 1
  • 1
casillas
  • 16,351
  • 19
  • 115
  • 215
  • It might sound silly, but have you tried adding something simpler to `infoWindow.Click`? Maybe show a `Toast` to proof that a click event is not regestering – Renats Stozkovs Mar 15 '17 at 17:26
  • I have already spent different approaches, the first one I tried is `infoWindow.Click`.. http://stackoverflow.com/questions/42728757/markerclick-works-but-infowindowclick-does-not-open-viewmodel – casillas Mar 15 '17 at 17:28

0 Answers0