示例#1
0
        private void MapMain_MapRightTapped(MapControl sender, MapRightTappedEventArgs args)
        {
            GeocodingLocation TapLocation = new GeocodingLocation(args.Location);

            MapPin newPin = new MapPin();

            newPin.DataContext = TapLocation;

            MapMain.Children.Add(newPin);
            MapControl.SetLocation(newPin, args.Location);
            MapControl.SetNormalizedAnchorPoint(newPin, new Point(0.5, 1));

            NavigationManager.Current.ShowLocation(TapLocation);
        }
        public void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            // Raise the PropertyChanged event, passing the name of the property whose value has changed.
            this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));

            if (propertyName == "Location")
            {
                if (location != null && location is GeocodingLocation)
                {
                    GeocodingLocation geoLoc = location as GeocodingLocation;

                    if (geoLoc.Status == null)
                    {
                        GeocodingProgress.Visibility = Windows.UI.Xaml.Visibility.Visible;
                    }
                    else
                    {
                        GeocodingProgress.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                    }
                }
            }
        }