LecturePage.xaml.cs CampusAppWP8::Pages::Lecture::LecturePage CampusAppWP8::Pages::Lecture //----------------------------------------------------------------------- //<copyrightfile="LecturePage.xaml.cs"company="BTU/IIT"> //Companycopyrighttag. //</copyright> //<author>stubbfel</author> //<sience>13.06.2013</sience> //---------------------------------------------------------------------- namespaceCampusAppWP8.Pages.Lecture { usingSystem; usingSystem.Collections.Generic; usingSystem.Windows; usingSystem.Windows.Navigation; usingCampusAppWP8.Feed.Lecture; usingCampusAppWP8.Model.Lecture; usingCampusAppWP8.Model.Utility; usingCampusAppWP8.Resources; usingCampusAppWP8.Utility; usingMicrosoft.Phone.Controls; publicpartialclassLecturePage:PhoneApplicationPage { privateLectureFeedfeed; privateList<ListPickerItemModel>courseList=newList<ListPickerItemModel>() { newListPickerItemModel() { Text="Architektur",Value="013" }, newListPickerItemModel() { Text="Bauingenieurwesen",Value="017" }, newListPickerItemModel() { Text="Betriebswirtschaftslehre",Value="021" } }; privateList<ListPickerItemModel>degreeList=newList<ListPickerItemModel>() { newListPickerItemModel() { Text=AppResources.Degree_Bachelor,Value="82" }, newListPickerItemModel() { Text=AppResources.Degree_Master,Value="88" }, newListPickerItemModel() { Text=AppResources.Degree_Diploma,Value="11" } }; privateList<ListPickerItemModel>semesterList=newList<ListPickerItemModel>() { newListPickerItemModel() { Text="SoSe13",Value="20131" }, newListPickerItemModel() { Text="WiSe13/14",Value="20132" }, newListPickerItemModel() { Text="SoSe14",Value="20141" } }; privateList<ListPickerItemModel>numberList=newList<ListPickerItemModel>() { newListPickerItemModel() { Text="1",Value="1" }, newListPickerItemModel() { Text="2",Value="2" }, newListPickerItemModel() { Text="3",Value="3" }, newListPickerItemModel() { Text="4",Value="4" } }; publicLecturePage() { this.InitializeComponent(); this.SetupListPickers(); } privatevoidSetupListPickers() { this.Course.ItemsSource=this.courseList; this.Degree.ItemsSource=this.degreeList; this.From.ItemsSource=this.numberList; this.To.ItemsSource=this.numberList; this.Semester.ItemsSource=this.semesterList; } privatevoidSendRequest(objectsender,RoutedEventArgse) { ListPickerItemModelsemester=(ListPickerItemModel)this.Semester.SelectedItem; ListPickerItemModeldegree=(ListPickerItemModel)this.Degree.SelectedItem; ListPickerItemModelcourse=(ListPickerItemModel)this.Course.SelectedItem; ListPickerItemModelfrom=(ListPickerItemModel)this.From.SelectedItem; ListPickerItemModelto=(ListPickerItemModel)this.To.SelectedItem; Urirequest=LectureFeed.CreateFeedUrl(semester.Value,degree.Value,course.Value,from.Value,to.Value); this.feed=newLectureFeed(request); this.feed.EventHandler.FeedIsReadyEvent+=newFeedEventHandler.FeedReadyHandler(this.FeedIsReady); this.ProgressBar.Visibility=System.Windows.Visibility.Visible; this.feed.LoadFeed(); } privatevoidFeedIsReady() { App.SaveToIsolatedStorage<LectureList>(Constants.IsolatedStorageLectureModel,this.feed.Model); this.ProgressBar.Visibility=System.Windows.Visibility.Collapsed; Uriurl=newUri(Constants.PathResultPage,UriKind.Relative); NavigationService.Navigate(url); } } }