private void HideLandmark() { if (_activeLocation != null) { _activeLocation = null; (this.Resources["HideLandmark"] as Storyboard).Begin(); } }
private void ShowLandmark(Landmark landmark) { this.LandmarkName.Text = landmark.Name; var imageUri = new Uri(landmark.ImageSource, UriKind.Relative); BitmapImage bi = new BitmapImage(imageUri); this.LandmarkImage.Source = bi; (this.Resources["ShowLandmark"] as Storyboard).Begin(); }
private void ShowNearestPOI(GeoCoordinate geoCoordinate) { var nearest = this.DefaultViewModel.Landmarks.OrderBy(x => geoCoordinate.GetDistanceTo(x.Geocoordinate)).First(); var distance = geoCoordinate.GetDistanceTo(nearest.Geocoordinate); double notificationThreshold = 500; if (distance < notificationThreshold) { if (_activeLocation != nearest) { _activeLocation = nearest; ShowLandmark(nearest); } } else { HideLandmark(); } }
private Landmark GetEmbarcadero() { Landmark l = new Landmark() { Name = "Embarcadero", Geocoordinate = new GeoCoordinate(37.79625,-122.405115), ImageSource = "Images/Embarcadero.png" }; return l; }
private Landmark GetRodeoBeach() { Landmark l = new Landmark() { Name = "Rodeo Beach", Geocoordinate = new GeoCoordinate(37.8300, -122.5358), ImageSource = "Images/RodeoBay.png" }; return l; }
private Landmark GetMosconeCenter() { Landmark l = new Landmark() { Name = "Moscone Center", Geocoordinate = new GeoCoordinate(37.784173, -122.401557), ImageSource = "Images/MosconeCenter.png" }; return l; }
private Landmark GetGoldenGateBridge() { Landmark l = new Landmark() { Name = "Golden Gate Bridge", Geocoordinate = new GeoCoordinate(37.81997, -122.47859), ImageSource = "Images/GoldenGateBridge.png" }; return l; }