public List <PageData> Load(LinkItemCollection links) { if (links == null || links.Count == 0) { return(ServiceLocator.Current.GetInstance <IContentRepository>().GetChildren <PageData>(ContentReference.StartPage).ToList()); } MainMenuLinks = links.ToPages(); return(MainMenuLinks); }
public bool Init(LinkItemCollection linkCollection) { var pdList = linkCollection.ToPages(); var enumerable = FilterForVisitor.Filter(pdList); foreach (var child in enumerable) { Items.Add(new PageDataItem((PageData)child)); } return(Items.Count != 0); }
public bool Init(LinkItemCollection linkCollection) { var pdList = new List <PageData>(); foreach (var pages in linkCollection.ToPages()) { pdList.AddRange(ServiceLocator.Current.GetInstance <IContentRepository>().GetChildren <PageData>(pages.PageLink)); } var enumerable = FilterForVisitor.Filter(pdList); foreach (var child in enumerable) { Items.Add(new PageDataItem((PageData)child)); } return(Items.Count != 0); }
/// <summary> /// Converts a LinkItemCollection to a list of pages. Any non-pages will be filtered out. (PageList compatible) /// </summary> /// <param name="linkItemCollection"></param> /// <returns>A list of typed PageData</returns> public static List <PageData> ToPageDataList(this LinkItemCollection linkItemCollection) { return(linkItemCollection.ToPages <PageData>().ToList()); }
/// <summary> /// Converts a LinkItemCollection to typed pages. Any non-pages will be filtered out. (PageList compatible) /// </summary> /// <typeparam name="T">PageType</typeparam> /// <param name="linkItemCollection"></param> /// <returns>A list of typed PageData</returns> public static List <T> ToPageDataList <T>(this LinkItemCollection linkItemCollection) where T : PageData { return(linkItemCollection.ToPages <T>().ToList()); }