public CoreRootPage(Page rootPage, NavigationBehavior navigationBehavior = NavigationBehavior.PushAsync) { IStringProvider stringProvider = DependencyService.Get <IStringProvider>(); Title = stringProvider.CoreGalleryTitle; var corePageView = new CorePageView(rootPage, navigationBehavior); var searchBar = new SearchBar() { AutomationId = "SearchBar" }; var testCasesButton = new Button { Text = "Go to Test Cases", AutomationId = "GoToTestButton", Command = new Command(async() => { if (!string.IsNullOrEmpty(searchBar.Text)) { await corePageView.PushPage(searchBar.Text); } else { await Navigation.PushModalAsync(TestCases.GetTestCases()); } }) }; var stackLayout = new StackLayout() { Children = { testCasesButton, searchBar, new Button { Text = "Click to Force GC", Command = new Command(() => { GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); }) } } }; Content = new AbsoluteLayout { Children = { { new CoreRootView(), new Rectangle(0, 0.0, 1, 0.35), AbsoluteLayoutFlags.All }, { stackLayout, new Rectangle(0, 0.5, 1, 0.30), AbsoluteLayoutFlags.All }, { corePageView, new Rectangle(0, 1.0, 1.0, 0.35), AbsoluteLayoutFlags.All }, } }; }