private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { List<string> list_string = new List<string>(); list_string = (List<string>)e.NavigationParameter; latitude = list_string[0]; longitude = list_string[1]; }
private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { List<string> list_string = new List<string>(); list_string = (List<string>)e.NavigationParameter; Util.debugLog(list_string[0], list_string[1]); if (list_string[1].Equals("All")) { item = DataSource.GetBean_All(Convert.ToInt32(list_string[0])); } else { item = DataSource.GetBean_Location(Convert.ToInt32(list_string[0])); } title1 = item.title; Title.Text = item.title; Type.Text = item.type; Status.Text = item.status; Landmark.Text = item.landmark; Description.Text = item.description; Util.debugLog("Testing"); Util.debugLog(item.image.Length.ToString()); if (!item.image.Equals("")) { Util.debugLog("Testing into description !!!"); Util.debugLog(item.image.Length.ToString()); ///PostDetailsImage.Source = new BitmapImage(new Uri(item.image)); byte[] byteBuffer = Convert.FromBase64String(item.image); // PostDetailsImage.Source = byteArrayToImage(byteBuffer); byteArrayToImage(byteBuffer); } latitude = item.latitude; longitude = item.longitude; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { showProcessRing(); //var sampleDataGroups = await DataSource.GetGroupsAsync(); //foreach (SampleDataItem item in sampleDataGroups) //{ // Utils.Util.debugLog(item.Title, item.type, item.Index, item.image,"***1"); //} ////this.DefaultViewModel["Groups"] = sampleDataGroups; var sampleDataGroups_Location = await DataSource.GetLocationAsync(); foreach (SampleDataItem item in sampleDataGroups_Location) { Utils.Util.debugLog(item.Title, item.type, item.Index, "***1"); } string latitude; string longitude; Geolocator geolocator = new Geolocator(); geolocator.DesiredAccuracyInMeters = 50; try { Geoposition geoposition = await geolocator.GetGeopositionAsync( maximumAge: TimeSpan.FromMinutes(5), timeout: TimeSpan.FromSeconds(10) ); latitude = geoposition.Coordinate.Point.Position.Latitude.ToString("0.00"); longitude = geoposition.Coordinate.Point.Position.Longitude.ToString("0.00"); } catch (Exception ex) { if ((uint)ex.HResult == 0x80004004) { // the application does not have the right capability or the location master switch is off // Util.displayMessage("", "Location is disabled in phone settings"); //locationHeader.Text = "Location is disabled in phone settings"; } else { // Util.displayMessage("", "Something else happened acquring the location"); // locationHeader.Text = "Couldn't get location "; } } this.DefaultViewModel["Groups1"] = sampleDataGroups_Location; var sampleDataGroups_Favourite = await DataSource.GetFavouriteAsync(); foreach (SampleDataItem item in sampleDataGroups_Favourite) { Utils.Util.debugLog(item.Title, item.type, item.Index, "***1"); } this.DefaultViewModel["Groups2"] = sampleDataGroups_Favourite; hideProcessRing(); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { Util.debugLog(Constants.DISPLAY_NAME, Constants.EMAIL_ID, Constants.MOBILE_NUMBER); UserName.Text = Constants.DISPLAY_NAME; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { Util.EmptyBackStack(this.Frame); }