1

I am using Xamarin and I am wanting to create a CustomWindowAdapter that implements a GoogleMap.InfoWindowAdapter interface.

I have tried this so far:

public class CustomWindowAdapter : InfoWindowAdapter
{

}

I am getting this error:

Error CS0246: The type or namespace name 'InfoWindowAdapter' could not be found (are you missing a using directive or an assembly reference?)

Here is the documentation for the interface: https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/GoogleMap.InfoWindowAdapter

Can I please have some help?

What using statement do I need to use?

Thanks in advance

Garry
  • 1,251
  • 9
  • 25
  • 45

1 Answers1

7

Step 1: Get Google Play Services component from Component Store

Step 2: Implement GoogleMap.IInfoWindowAdapter

using Android.Gms.Maps;
using Android.Gms.Maps.Model;
using Android.Views;

public class InfoWindow : Java.Lang.Object, GoogleMap.IInfoWindowAdapter
{
    #region IInfoWindowAdapter implementation

    public View GetInfoContents(Marker p0)
    {
        throw new NotImplementedException ();
    }

    public View GetInfoWindow(Marker p0)
    {
        throw new NotImplementedException ();
    }

    #endregion
}
SKall
  • 5,234
  • 1
  • 16
  • 25
  • Thank you. That works. Can I ask you how you found the correct references? – Garry Feb 18 '14 at 06:11
  • In C# an interface naming convention is to start it with I and the rest is pretty much in the Android documentation. The biggest thing is to find out whether it is an interface or abstract class, that will determine the Xamarin naming. – SKall Feb 18 '14 at 13:10