Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- x:Class="LoginApp.Droid.Views.LocationPage"
- NavigationPage.HasNavigationBar="False"
- BackgroundColor="#E5FFC4"
- Loaded="LocationPage_Loaded">
- private async void LocationPage_Loaded(object sender, EventArgs e)
- {
- var locator = CrossGeolocator.Current;
- locator.DesiredAccuracy = 50;
- var position = await locator.GetPositionAsync(TimeSpan.FromMinutes(3), includeHeading: true);
- Entry_Longitude.Text = position.Longitude.ToString();
- Entry_Latitude.Text = position.Latitude.ToString();
- }
Add Comment
Please, Sign In to add comment