Template 10

Source on GitHub

Template 10

OnNavigatedTo

public override void OnNavigatedTo(string parameter, NavigationMode mode, IDictionary<string, object> state)
{
  try
  {
    FirstName = state["FirstName"]?.ToString();
    LastName = state["LastName"]?.ToString
  }
  finally
  {
    state.Clear();
  }
}

OnNavigatedFrom

public override Task OnNavigatedFromAsync(IDictionary<string, object> state, bool suspending)
{
  if(suspending)
  {
    state["FirstName"] = this.FirstName;
    state["LastName"] = this.LastName;
  }
  
  return Task.FromResult<object>(null);
}