private void OnVectorLayersMenuItemClicked(object sender, PopupMenu.MenuItemClickEventArgs e)
{
// Get title from the selected item
var selected = e.Item.TitleCondensedFormatted.ToString();
// Get index that is used to get the selected url
var selectedIndex = _vectorLayerNames.ToList().IndexOf(selected);
switch (selectedIndex)
{
case 0:
_vectorTiledLayerUrl = _darkGrayUrl;
break;
case 1:
_vectorTiledLayerUrl = _streetUrl;
break;
case 2:
_vectorTiledLayerUrl = _nightUrl;
break;
case 3:
_vectorTiledLayerUrl = _navigationUrl;
break;
}
// Create new ArcGISVectorTiled layer with the selected service Url
_vectorTiledLayer = new ArcGISVectorTiledLayer(new Uri(_vectorTiledLayerUrl));
// Create a new map with a basemap that was selected. Assign this to the mapview's map
_myMapView.Map = new Map(new Basemap(_vectorTiledLayer));
}