private async void ReadingList_ItemClick(object sender, ItemClickEventArgs e) { var model = e.ClickedItem as SearchReadingModel; if (model != null) { switch (model.Type) { case "essay": NavigationManager.GeneralNavigate( typeof(EssayDetailPage), await ReadingDetailPageViewModelBase.CreateViewModel <EssayDetailPageViewModel>(model.Id)); return; case "question": NavigationManager.GeneralNavigate( typeof(QuestionDetailPage), await ReadingDetailPageViewModelBase.CreateViewModel <QuestionDetailPageViewModel>(model.Id)); return; case "serialcontent": NavigationManager.GeneralNavigate( typeof(SerialDetailPage), await ReadingDetailPageViewModelBase.CreateViewModel <SerialDetailPageViewModel>(model.Id)); return; default: return; } } }
private static async Task <ReadingDetailPageViewModelBase> CreateReadingDetailPageViewModel(string type, string id) { switch (type) { case "3": return(await ReadingDetailPageViewModelBase.CreateViewModel <QuestionDetailPageViewModel>(id)); case "1": return(await ReadingDetailPageViewModelBase.CreateViewModel <EssayDetailPageViewModel>(id)); case "2": return(await ReadingDetailPageViewModelBase.CreateViewModel <SerialDetailPageViewModel>(id)); default: return(null); } }