private void AddAnnotation(object item) { if (item is Vehicle) { var vehicle = item as Vehicle; var annotation = new VehicleAnnotation(vehicle); if (this.ShowDetailsCommand != null) { annotation.ShowDetailCommand = this.ShowDetailsCommand; annotation.VehicleId = vehicle.VehicleId; } _annotations.Add(vehicle, annotation); _mapView.AddAnnotation(annotation); } }
private string GetImageFilePath(VehicleAnnotation vehicleAnnotation) { var imageFilename = vehicleAnnotation.IsFree ? "car-available" : "car-occupied"; var imageFilePath = imageFilename + ".png"; return imageFilePath; }