// Invoked when the app has navigated to Main page
        public void NavigatedToMainPage(IMowblyPhoneApplicationPage phoneApplicationPage, NavigationEventArgs e)
        {
            // Check if the page has resumed from tombstone
            if (phoneApplicationPage.IsNewInstance && e.NavigationMode == NavigationMode.Back)
            {
                // Set app from tombstone.
                // Redundant setting. Already done in OnAppActivated. Can be used in future.
                IsAppFromTombstone = true;
            }

            // Set active PhoneApplicationPage
            SetActivePhoneApplicationPage(phoneApplicationPage);

            // Check if app had navigated back from external/internal app
            if (!Mowbly.AppNavigatedToExternalPage &&
                !Mowbly.AppNavigatedToInternalPage)
            {
                // Trigger foreground tasks
                RunForegroundTasks();
            }
            else
            {
                Mowbly.AppNavigatedToExternalPage = false;
                Mowbly.AppNavigatedToInternalPage = false;
            }

            if (PageManager.Instance.ActivePage == null)
            {
                LaunchHomePage();
            }
        }
 /// <summary>
 /// Sets the active PhoneApplicationPage.
 /// Should be set by the app that uses the framework.
 /// </summary>
 /// <param name="phoneApplicationPage">
 /// <see cref="CloudPact.MowblyFramework.Core.Ui.IMowblyPhoneApplicationPage">IMowblyPhoneApplicationPage</see> object
 /// </param>
 public void SetActivePhoneApplicationPage(IMowblyPhoneApplicationPage phoneApplicationPage)
 {
     Mowbly.ActivePhoneApplicationPage = phoneApplicationPage;
 }