/// <summary> /// Returns a page control for a given type. /// </summary> public IPageControl CreatePageControl(PageControlTypes pageControlType) { switch (pageControlType) { case PageControlTypes.Favorites: return(new FavoritesPageControl()); case PageControlTypes.RealTime: return(new RealTimePageControl()); case PageControlTypes.TimeTable: return(new TimeTablePageControl()); case PageControlTypes.TripDetails: return(new TripDetailsPageControl()); default: throw new NotSupportedException(); } }
/// <summary> /// Creates a page control instance. /// </summary> public IPageControl CreatePageControl(PageControlTypes pageControlType) { switch (pageControlType) { case PageControlTypes.Favorites: return(new FavoritesPageControl()); case PageControlTypes.RealTime: return(new RealTimePageControl()); case PageControlTypes.SearchResults: return(new SearchResultsPageControl()); case PageControlTypes.TimeTable: return(new TimeTablePageControl()); case PageControlTypes.TripDetails: return(new TripDetailsPageControl()); default: throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Unsupported page control type {0}", pageControlType)); } }
/// <summary> /// Creates a page control instance. /// </summary> public IPageControl CreatePageControl(PageControlTypes pageControlType) { switch(pageControlType) { case PageControlTypes.Favorites: return new FavoritesPageControl(); case PageControlTypes.RealTime: return new RealTimePageControl(); case PageControlTypes.SearchResults: return new SearchResultsPageControl(); case PageControlTypes.TimeTable: return new TimeTablePageControl(); case PageControlTypes.TripDetails: return new TripDetailsPageControl(); default: throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Unsupported page control type {0}", pageControlType)); } }
/// <summary> /// Navigates to a page control. /// </summary> public async Task NavigateToPageControlAsync(PageControlTypes type, object parameter) { IPageControl newPageControl = ServiceRepository.PageControlService.CreatePageControl(type); await NavigateToPageControlAsync(newPageControl, parameter); }