예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LoadStateEventArgs"/> class.
 /// </summary>
 /// <param name="navigationParameter">
 /// The parameter value passed to <see cref="Frame.Navigate(Type, Object)"/>
 /// when this page was initially requested.
 /// </param>
 /// <param name="pageState">
 /// A dictionary of state preserved by this page during an earlier
 /// session.  This will be null the first time a page is visited.
 /// </param>
 public LoadStateEventArgs(NavigationEventArgs e, IDictionary <string, object> pageState, bool isViewInitialized)
     : base()
 {
     this.NavigationEventArgs = e;
     this.PageState           = pageState;
     this.Parameter           = NavigationParameterSerializer.Deserialize(e.Parameter); // Deserializes the parameter from the navigation event if necessary and stores instance
     this.IsViewInitialized   = isViewInitialized;
 }
예제 #2
0
 /// <summary>
 /// Serializes a parameter to string if not a primitive type so that app suspension can properly happen.
 /// </summary>
 /// <param name="obj">Parameter object to serialize.</param>
 /// <returns></returns>
 protected object SerializeParameter(object obj)
 {
     return(NavigationParameterSerializer.Serialize(obj));
 }