/// <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) { Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; if (localSettings.Values.ContainsKey("Baby_Name")) enterBabyNameTextBox1.Text = localSettings.Values["Baby_Name"].ToString(); if (localSettings.Values.ContainsKey("Baby_Weight")) enterBabyNameTextBox2.Text = localSettings.Values["Baby_Weight"].ToString(); if (localSettings.Values.ContainsKey("Product_ID")) enterBabyNameTextBox3.Text = localSettings.Values["Product_ID"].ToString(); if (localSettings.Values.ContainsKey("Gender")) { if (localSettings.Values["Gender"].ToString() == "Male") genderCheckBox1.IsChecked = true; else if (localSettings.Values["Gender"].ToString() == "Female") genderCheckBox2.IsChecked = true; } if (localSettings.Values.ContainsKey("Contact_Number")) textBox1.Text = localSettings.Values["Contact_Number"].ToString(); }
private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { }