protected virtual async Task InternalNavigateToAsync(Type viewModelType, object parameter) { var page = CreatePage(viewModelType, parameter); if (page is MainView || page is LogInView) { CurrentApplication.MainPage = page; } else if (CurrentApplication.MainPage is MainView) { var mainPage = CurrentApplication.MainPage as MainView; CustomNavigationPage navigationPage; if (page is IMainPageDetail) { navigationPage = new CustomNavigationPage(page); mainPage.Detail = navigationPage; } else { navigationPage = mainPage.Detail as CustomNavigationPage; var currentPage = navigationPage.CurrentPage; if (currentPage.GetType() != page.GetType()) { await navigationPage.PushAsync(page); } } mainPage.IsPresented = false; } else { CustomNavigationPage navigationPage = CurrentApplication.MainPage as CustomNavigationPage; if (navigationPage != null) { await navigationPage.PushAsync(page); } else { CurrentApplication.MainPage = new CustomNavigationPage(page); } } await(page.BindingContext as BaseViewModel).InitializeAsync(parameter); }