internal static CKCluster GetCluster(this IEnumerable <IMKAnnotation> annotations, TKCustomMapAnnotation annotation) { return(annotations.OfType <CKCluster>().FirstOrDefault(i => i.Annotations.Count() == 1 && i.FirstAnnotation.Equals(annotation))); }
/// <summary> /// Creates the annotations /// </summary> private void UpdatePins() { this.Map.RemoveAnnotations(this.Map.Annotations); if (this.FormsMap.CustomPins == null || !this.FormsMap.CustomPins.Any()) return; foreach (var i in FormsMap.CustomPins) { if (this._firstUpdate) { i.PropertyChanged += OnPinPropertyChanged; } var pin = new TKCustomMapAnnotation(i); this.Map.AddAnnotation(pin); } this._firstUpdate = false; if (this.FormsMap.PinsReadyCommand != null && this.FormsMap.PinsReadyCommand.CanExecute(this.FormsMap)) { this.FormsMap.PinsReadyCommand.Execute(this.FormsMap); } }