Beispiel #1
0
        public static async Task GetClosestCity()
        {
            Geolocator geoLocator = new Geolocator();

            try
            {
                var pos = await geoLocator.GetGeopositionAsync();

                String cityToken = Calender2.Data.CityData.FindClosestCity(pos.Coordinate.Latitude, pos.Coordinate.Longitude);
                await SampleDataSource.ChangeCity(cityToken);
            }
            catch (Exception ex)
            {
                // catch all exceptions as getgeopositionasync seems to throw exceptions if it cannot get location
                Debug.WriteLine("Access not given to use location" + ex.Message);
            }
        }
 public static async Task InitializeCalendarData()
 {
     _sampleDataSource = new SampleDataSource();
     await _sampleDataSource.GetCalendarYearData();
 }
Beispiel #3
0
 public static async Task InitializeCalendarData()
 {
     _sampleDataSource = new SampleDataSource();
     await _sampleDataSource.GetCalendarYearData();
 }