示例#1
0
        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;
        }
示例#2
0
        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;
            }
        }
示例#3
0
        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;
            }
        }