예제 #1
0
        void navigationHelper_SaveState(object sender, SaveStateEventArgs e)
        {
            e.PageState.Clear();

            e.PageState["Value1TextBox"] = Value1TextBox.Text;
            e.PageState["Value2TextBox"] = Value2TextBox.Text;
            if (RadioButton1.IsChecked.HasValue)
            {
                e.PageState["RadioButton1Value"] = RadioButton1.IsChecked.Value ? 1 : 0;
            }
            if (RadioButton2.IsChecked.HasValue)
            {
                e.PageState["RadioButton2Value"] = RadioButton2.IsChecked.Value ? 1 : 0;
            }
            if (RadioButton3.IsChecked.HasValue)
            {
                e.PageState["RadioButton3Value"] = RadioButton3.IsChecked.Value ? 1 : 0;
            }
        }
 /// <summary>
 /// Preserves state associated with this page in case the application is suspended or the
 /// page is discarded from the navigation cache.  Values must conform to the serialization
 /// requirements of <see cref="SuspensionManager.SessionState"/>.
 /// </summary>
 /// <param name="sender">The source of the event; typically <see cref="NavigationHelper"/></param>
 /// <param name="e">Event data that provides an empty dictionary to be populated with
 /// serializable state.</param>
 private void NavigationHelper_SaveState(object sender, SaveStateEventArgs e)
 {
 }