public NavigationPage GetCurrentRootPage() { var masterDetailPage = _pageProvider.GetMasterDetailPage(); var rootPage = masterDetailPage?.Detail; return(rootPage as NavigationPage); }
public async Task SetRootAsync(Type viewmodelType) { if (viewmodelType == null) { throw new ArgumentNullException(nameof(viewmodelType)); } var rootPage = await GetRootPage(viewmodelType); var masterDetailPage = _masterDetailPageProvider.GetMasterDetailPage(); masterDetailPage.Detail = rootPage; // TODO: improve log message _logger.LogDebug("Changed root page!"); }
// TODO: refactor the page creation logic out of here protected override async void OnStart() { base.OnStart(); await _databaseInitializationService.InitializeDatabaseAsync(); await _resourceInitializationService.InitializeResourcesAsync(); var mainPage = _masterDetailPageProvider.GetMasterDetailPage(); var masterPage = _pageFactory.CreatePage <MasterPage>(); mainPage.Master = masterPage; await masterPage.InitializeViewmodelAsync(null); MainPage = mainPage; _logger.LogInformation("Application has successfully started!"); }
private void OnEntrySelected(object sender, SelectedItemChangedEventArgs e) { if (SelectCommand == null) { return; } var entry = e.SelectedItem; if (SelectCommand.CanExecute(entry)) { SelectCommand.Execute(entry); } var masterDetailPage = _pageProvider.GetMasterDetailPage(); masterDetailPage.IsPresented = false; }