Beispiel #1
0
        private void DidSelectLocationHandler(object sender, LocationPickerPageEventArgs e)
        {
            var page = sender as LocationPickerPage;

            var place = e.Item;

            string location = place.Latitude.ToString("F7", System.Globalization.CultureInfo.InvariantCulture) + "," + place.Longitude.ToString("F7", System.Globalization.CultureInfo.InvariantCulture);
            string address  = place.Address;

            if (page.PickerType == LocationPickerType.From)
            {
                ViewModel.FromLocationGPS     = location;
                ViewModel.FromLocationAddress = address;
                ViewModel.FromCountry         = place.Country;
            }
            else if (page.PickerType == LocationPickerType.To)
            {
                ViewModel.ToLocationGPS     = location;
                ViewModel.ToLocationAddress = address;
                ViewModel.ToCountry         = place.Country;
            }

            SetLocationImage(page.PickerType, place.Latitude, place.Longitude);
        }
        private void DidSelectLocationHandler(object sender, LocationPickerPageEventArgs e)
        {
            eventHandler(this, new LocationPickerPageEventArgs(e.Item));

            Navigation.PopAsync();
        }