Beispiel #1
0
        protected virtual Page ResolvePage(LazyLoadedPage lazyLoadedPage)
        {
            var innerPage = FreshPageModelResolver.ResolvePageModel(lazyLoadedPage.ViewModelType, lazyLoadedPage.Data);

            innerPage.GetModel().CurrentNavigationServiceName = NavigationServiceName;
            return(CreateContainerPage(innerPage));
        }
Beispiel #2
0
        public virtual void AddPage(string modelName, string title, string icon = null, object data = null)
        {
            var pageToAdd = new LazyLoadedPage {
                ViewModelType = Type.GetType(modelName), Data = data, Title = title, Icon = icon
            };

            Pages.Add(pageToAdd);

            if (Pages.Count == 1)
            {
                Detail = ResolvePage(pageToAdd);
            }
        }
Beispiel #3
0
        public virtual void AddPage <T>(string title, string group, string icon = null, int tabGroupIndex = 0, object data = null) where T : FreshBasePageModel
        {
            var pageToAdd = new LazyLoadedPage
            {
                ViewModelType = typeof(T),
                Data          = data,
                Title         = title,
                Icon          = icon,
                Group         = group,
                TabGroupIndex = tabGroupIndex
            };

            Pages.Add(pageToAdd);

            if (Pages.Count == 1)
            {
                Detail = ResolvePage(pageToAdd);
            }

            _listView.ItemsSource = Pages.GroupBy(item => item.Group).Select(item => new Grouping <string, LazyLoadedPage>(item.Key, item.ToList())).ToList();
        }