예제 #1
0
 private void NavigationHelper_SaveState(object sender, SaveStateEventArgs e)
 {
     // save selected players
     string selectedPlayers = checkSelectedPlayers();
     Debug.WriteLine("SaveState SelectedPlayers: " + selectedPlayers);
     Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
     localSettings.Values["SelectedPlayers"] = selectedPlayers;
 }
예제 #2
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)
        {

            // no specific state to save
        }
예제 #3
0
        private void NavigationHelper_SaveState(object sender, SaveStateEventArgs e)
        {
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
            }

            string players = "";
            for (int i = 0; i < pivot.Items.Count; ++i)
            {
                PivotItem item = pivot.Items[i] as PivotItem;
                CXPivotItem CXitem = item.Content as CXPivotItem;
                players += item.Header.ToString() + ";";
                e.PageState.Add(i.ToString(), CXitem.getThrowsIn() + ";" + CXitem.getThrowsOut() );
            }
            Debug.WriteLine("saved players: " + players);
            e.PageState.Add("Players", players);
            e.PageState.Add("SelectedIndex", pivot.SelectedIndex);
        }
 /// <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)
 {
 }
예제 #5
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)
 {
     if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
     {
         HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
     }
     var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
     localSettings.Values[PIVOT_INDEX] = this.pivot.SelectedIndex;
 }
예제 #6
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)
        {
            // save each player's game state
            string players = "";
            for (int i = 0; i < pivot.Items.Count; ++i)
            {
                PivotItem item = pivot.Items[i] as PivotItem;
                AboPivotItem pivotItem = item.Content as AboPivotItem;
                players += item.Header.ToString() + ";";
                e.PageState.Add(i.ToString(), pivotItem.getState());
                
                Debug.WriteLine("pagestate.add: i:" + i.ToString() + " " + pivotItem.getState());
            }
            e.PageState.Add("Players", players);
            e.PageState.Add("SelectedIndex", pivot.SelectedIndex);

            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
            }
        }