This repository was archived by the owner on Nov 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
src/Mobile/eShopOnContainers/eShopOnContainers.Core Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 11using eShopOnContainers . Core . Models . Location ;
2+ using eShopOnContainers . Core . Services . Dependency ;
23using eShopOnContainers . Core . Services . Location ;
34using eShopOnContainers . Core . Services . Settings ;
45using eShopOnContainers . Core . ViewModels . Base ;
56using eShopOnContainers . Services ;
7+ using System ;
8+ using System . Diagnostics ;
69using System . Globalization ;
710using System . Threading . Tasks ;
811using Xamarin . Forms ;
912using Xamarin . Forms . Xaml ;
10- using eShopOnContainers . Core . Services . Dependency ;
1113
1214[ assembly: XamlCompilation ( XamlCompilationOptions . Compile ) ]
1315namespace eShopOnContainers
@@ -76,10 +78,17 @@ private async Task GetGpsLocation()
7678
7779 // Delay getting the position to ensure that the UI has finished updating
7880 await Task . Delay ( 2000 ) ;
79- var position = await locator . GetPositionAsync ( ) ;
81+ try
82+ {
83+ var position = await locator . GetPositionAsync ( ) ;
8084
81- _settingsService . Latitude = position . Latitude . ToString ( ) ;
82- _settingsService . Longitude = position . Longitude . ToString ( ) ;
85+ _settingsService . Latitude = position . Latitude . ToString ( ) ;
86+ _settingsService . Longitude = position . Longitude . ToString ( ) ;
87+ }
88+ catch ( Exception ex )
89+ {
90+ Debug . WriteLine ( ex ) ;
91+ }
8392 }
8493 else
8594 {
You can’t perform that action at this time.
0 commit comments