/// <summary> /// Construct a DownloadsPage object. This is carried out by the Application /// because the downloads page is global and not owned by any single /// Experience. /// NOTE: This is public to enable debug markup access. /// </summary> public DownloadsPage CreateDownloadsPage() { DownloadsPage page = new DownloadsPage(); page.Description = Z.Resources.Downloads; // // Create one filter for each experience and one global "All" // filter that indicates all experiences. // ArrayListDataSet filters = new ArrayListDataSet(page); filters.Add(new DownloadFilter(page, "All", ActiveDownloads)); foreach (ApplicationExperience experience in experiences) { filters.Add(CreateDownloadPageFilter(page, experience)); } Choice filtersChoice = new Choice(page, null, filters); // Default to having "All" as the current filter filtersChoice.ChosenIndex = 0; page.Filters = filtersChoice; return(page); }
/// <summary> /// Create a download filter object from an experience. /// </summary> private static DownloadFilter CreateDownloadPageFilter(DownloadsPage page, ApplicationExperience experience) { return(new DownloadFilter(page, experience.Description, experience.ActiveDownloads)); }