public override void AddPage <T>(string title, object data = null) { Page page = FreshPageModelResolver.ResolvePageModel <T>(data); PageExtensions.GetModel(page).CurrentNavigationServiceName = this.NavigationServiceName; Page containerPage = this.CreateContainerPage(page); Pages.Add(title, containerPage); PageNames.Add(title); if (this.Pages.Count != 1) { return; } this.Detail = containerPage; }
public virtual void AddPage <T>(string title, object data = null) where T : FreshBasePageModel { var page = FreshPageModelResolver.ResolvePageModel <T>(data); page.GetModel().CurrentNavigationServiceName = NavigationServiceName; _pagesInner.Add(page); var navigationContainer = CreateContainerPage(page); Pages.Add(title, navigationContainer); PageNames.Add(title); if (Pages.Count == 1) { Detail = navigationContainer; } }
private void AddPagesToDictionary(Page page) { var viewModel = page.GetModel(); viewModel.CurrentNavigationServiceName = NavigationServiceName; _pagesInner.Add(page); Page navigationContainer = CreateContainerPage(page); if (string.IsNullOrEmpty(viewModel.Title)) { throw new Exception("no Title found for " + viewModel.GetType().Name); } Pages.Add(viewModel.Title, navigationContainer); PageNames.Add(viewModel.Title); if (Pages.Count == 1) { Detail = navigationContainer; } }