protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); string dateString = ""; _currentDayView = this; HinduCalendarPhone.App app = Application.Current as HinduCalendarPhone.App; if (NavigationContext.QueryString.TryGetValue("date", out dateString)) { Debug.WriteLine("Date to be shown is " + dateString); PageTitle.Text = dateString; app.CurrentDate = DateTime.Parse(dateString); } ShowDetail(); }
private void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs <GeoCoordinate> e) { System.Diagnostics.Debug.WriteLine("Location position changed {0} {1}", e.Position.Location.Latitude, e.Position.Location.Longitude); GeoCoordinate coord = e.Position.Location; if (coord.IsUnknown != true) { String cityToken = Calender2.Data.CityData.FindClosestCity(coord.Latitude, coord.Longitude); City city = Calender2.Data.CityData.GetCityInformation(cityToken); UpdateCityTokenAndGetData(cityToken, city._Name, city._timeZone); DayView.UpdateDayViewPageForNewCity(); } else { System.Diagnostics.Debug.WriteLine("Location services not initilaized"); } }
private void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e) { GeoCoordinateWatcher watcher = sender as GeoCoordinateWatcher; System.Diagnostics.Debug.WriteLine("Location services status" + watcher.Status.ToString()); if (e.Status == GeoPositionStatus.Ready) { GeoCoordinate coord = watcher.Position.Location; if (coord.IsUnknown != true) { String cityToken = Calender2.Data.CityData.FindClosestCity(coord.Latitude, coord.Longitude); City city = Calender2.Data.CityData.GetCityInformation(cityToken); UpdateCityTokenAndGetData(cityToken, city._Name, city._timeZone); DayView.UpdateDayViewPageForNewCity(); } else { System.Diagnostics.Debug.WriteLine("Location services not initilaized"); } } }