public void OpenDisplayPage(DisplayPage displayPage) { if (displayPage == DisplayPage.None) { return; } SensusContext.Current.MainThreadSynchronizer.ExecuteThreadSafe(async() => { Page desiredTopPage = null; if (displayPage == DisplayPage.PendingSurveys) { desiredTopPage = new PendingScriptsPage(); } else { SensusException.Report("Unrecognized display page: " + displayPage); return; } Page currentTopPage = Application.Current.MainPage.Navigation.NavigationStack.LastOrDefault(); if (currentTopPage == null || desiredTopPage.GetType() != currentTopPage.GetType()) { await Application.Current.MainPage.Navigation.PushAsync(desiredTopPage); } }); }
public void OpenDisplayPage(DisplayPage displayPage) { if (displayPage == DisplayPage.None) { return; } SensusContext.Current.MainThreadSynchronizer.ExecuteThreadSafe(() => { Page desiredTopPage = null; if (displayPage == DisplayPage.PendingSurveys) { desiredTopPage = new PendingScriptsPage(); } else { SensusException.Report("Unrecognized display page: " + displayPage); return; } (Application.Current as App).DetailPage = new NavigationPage(desiredTopPage); }); }