Alexandria.Common.SuspensionManager.SessionStateForFrame C# (CSharp) Метод

SessionStateForFrame() публичный статический Метод

Provides storage for session state associated with the specified Frame. Frames that have been previously registered with RegisterFrame have their session state saved and restored automatically as a part of the global SessionState. Frames that are not registered have transient state that can still be useful when restoring pages that have been discarded from the navigation cache.
Apps may choose to rely on NavigationHelper to manage page-specific state instead of working with frame session state directly.
public static SessionStateForFrame ( Frame frame ) : Object>.Dictionary
frame Windows.UI.Xaml.Controls.Frame The instance for which session state is desired.
Результат Object>.Dictionary
        public static Dictionary<String, Object> SessionStateForFrame(Frame frame)
        {
            var frameState = (Dictionary<String, Object>)frame.GetValue(FrameSessionStateProperty);

            if (frameState == null)
            {
                var frameSessionKey = (String)frame.GetValue(FrameSessionStateKeyProperty);
                if (frameSessionKey != null)
                {
                    // Registered frames reflect the corresponding session state
                    if (!_sessionState.ContainsKey(frameSessionKey))
                    {
                        _sessionState[frameSessionKey] = new Dictionary<String, Object>();
                    }
                    frameState = (Dictionary<String, Object>)_sessionState[frameSessionKey];
                }
                else
                {
                    // Frames that aren't registered have transient state
                    frameState = new Dictionary<String, Object>();
                }
                frame.SetValue(FrameSessionStateProperty, frameState);
            }
            return frameState;
        }