title: Xamarin Forms OnResume special processing
body: <p>When my Xamarin Forms cross platform app resumes, I want to intercept the navigation and transfer to a loading page I have that checks to see if certain data has changed etc.  After I perform this processing, if nothing has changed, I want to resume the navigation to the original page the onresume would have taken me to.  </p>
  
  <p>So to start with I have saved an instance of the page the check for changes in the data in a variable in my app.xaml.cs file.  When my app starts, I created an instance of the page I want and navigate to it.  Below is the code from my app.xaml.cs file:</p>
  
  <pre><code>            gobj_BaseLoadingPage = new baseloadingpage();
  
              if (Application.Current.MainPage == null)
              {
                  Application.Current.MainPage = new NavigationPage(gobj_BaseLoadingPage);
              }
  </code></pre>
  
  <p>So now in the on resume, I want to go back to this loading page.  I have tried many variations of the code below but I cannot seem to get it to work.  With the code below, by base loading page is never displayed and the app simply goes back to the page it was on when it was suspended.  </p>
  
  <pre><code>        App.Current.MainPage = (Page)gobj_BaseLoadingPage.Parent;
          gobj_BaseLoadingPage.Parent = null;
          Application.Current.MainPage.Navigation.PushAsync(gobj_BaseLoadingPage);
  </code></pre>
  
  <p>If I just do a pushasync with the page without clearing its parent I get an error that the page cannot already have a parent.  </p>
  
  <p>Any suggestions would be greatly appreciated.</p>