private AppContextLiveData() : base() { _locationProvider = new GpsLocationProvider(); _compassProvider = new CompassProvider(); _locationTimer = new System.Timers.Timer(); _locationTimer.Interval = 3000; _locationTimer.Elapsed += OnLocationTimerElapsed; _compassProvider.OnHeadingChanged = OnHeadingChanged; }
public static async Task <PoiCountry?> GetDefaultCountryByPhoneLocation() { PoiCountry?defaultCountry = null; var location = await GpsLocationProvider.GetLastKnownLocationAsync(); if (location != null) { var placeInfo = await PlaceNameProvider.AsyncGetPlaceName(location); defaultCountry = placeInfo?.Country; } if (!defaultCountry.HasValue) { defaultCountry = PoiCountryHelper.GetDefaultCountryByPhoneSettings(); } return(defaultCountry); }