private void PopulateCentre(Coordinate location) { if (location == null) return; this.Centre.Latitude = location.Latitude; this.Centre.Longitude = location.Longitude; this.RaisePropertyChanged(() => this.Centre); }
private void PopulateNearbyCafes(Coordinate location) { if (location == null) return; foreach (var cafe in this.Cafes) { cafe.DistanceToCurrentLocation = location.DistanceTo(cafe); } var nearbyCafes = this.Cafes .Where(cafe => location.DistanceTo(cafe) < 1500) .OrderBy(cafe => cafe.DistanceToCurrentLocation) .Take(5); this.NearbyCafes.Clear(); foreach (var cafe in nearbyCafes) { this.NearbyCafes.Add(cafe); } }
private void PopulateCurrentLocation(Coordinate location) { if (location == null) return; this.CurrentLocation.Latitude = location.Latitude; this.CurrentLocation.Longitude = location.Longitude; this.RaisePropertyChanged(() => this.CurrentLocation); this.RecentreAtCurrentLocation.RaiseCanExecuteChanged(); }