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.Media.Imaging; usingSystem.Windows.Navigation; <<<<<<< HEAD usingCampusAppWP8.Api.Lecture; ======= usingCampusAppWP8.Feed.Lecture; >>>>>>> develmaster usingCampusAppWP8.Model.Lecture; usingCampusAppWP8.Model.Utility; usingCampusAppWP8.Resources; usingCampusAppWP8.Utility; usingMicrosoft.Phone.Controls; <<<<<<< HEAD publicpartialclassLecturePage:PhoneApplicationPage { #regionMember privateLectureApiapi; privateLecturePageModelpageModel; ======= publicpartialclassLecturePage:PhoneApplicationPage { #regionMember privateLectureApiapi; privateLecturePageModelpageModel; >>>>>>> develmaster #endregion #regionConstructor <<<<<<< HEAD publicLecturePage() ======= publicLecturePage() >>>>>>> develmaster { this.InitializeComponent(); this.LoadPageModel(); this.SetupListPickers(); } #endregion #regionmethods #regionprotected protectedoverridevoidOnNavigatedFrom(NavigationEventArgse) { if(NavigationMode.Back==e.NavigationMode) { //deleteallmodels <<<<<<< HEAD App.SaveToIsolatedStorage<LecturePageModel>(Constants.IsolatedStorage_LecturePageModel,null); App.SaveToIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel,null); ======= App.SaveToIsolatedStorage<LecturePageModel>(Constants.IsolatedStorage_LecturePageModel,null); App.SaveToIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel,null); >>>>>>> develmaster } else { this.StoreSelectedIndex(); <<<<<<< HEAD App.SaveToIsolatedStorage<LecturePageModel>(Constants.IsolatedStorage_LecturePageModel,this.pageModel); ======= App.SaveToIsolatedStorage<LecturePageModel>(Constants.IsolatedStorage_LecturePageModel,this.pageModel); >>>>>>> develmaster } base.OnNavigatedFrom(e); } #endregion #regionprivate privatevoidLoadPageModel() { <<<<<<< HEAD this.pageModel=newLecturePageModel(); ======= this.pageModel=newLecturePageModel(); >>>>>>> develmaster this.pageModel.LoadLists(); } privatevoidSetupListPickers() { this.Course.ItemsSource=this.pageModel.CourseList; this.Degree.ItemsSource=this.pageModel.DegreeList; this.From.ItemsSource=this.pageModel.NumberList; this.To.ItemsSource=this.pageModel.NumberList; this.Semester.ItemsSource=this.pageModel.SemesterList; //loadvaluesfromlastrequest <<<<<<< HEAD LecturePageModellastPageModel=App.LoadFromIsolatedStorage<LecturePageModel>(Constants.IsolatedStorage_LecturePageModel); ======= LecturePageModellastPageModel=App.LoadFromIsolatedStorage<LecturePageModel>(Constants.IsolatedStorage_LecturePageModel); >>>>>>> develmaster if(lastPageModel!=null) { this.SetLastSelectedIndex(lastPageModel); } this.SetSelectedIndex(); } <<<<<<< HEAD privatevoidSetLastSelectedIndex(LecturePageModellastPageModel) { this.pageModel.SelectCourseIndex=lastPageModel.SelectCourseIndex; this.pageModel.SelectDegreeIndex=lastPageModel.SelectDegreeIndex; this.pageModel.SelectFromIndex=lastPageModel.SelectFromIndex; this.pageModel.SelectToIndex=lastPageModel.SelectToIndex; this.pageModel.SelectSemesterIndex=lastPageModel.SelectSemesterIndex; ======= privatevoidSetLastSelectedIndex(LecturePageModellastPageModel) { this.pageModel.SelectCourseIndex=lastPageModel.SelectCourseIndex; this.pageModel.SelectDegreeIndex=lastPageModel.SelectDegreeIndex; this.pageModel.SelectFromIndex=lastPageModel.SelectFromIndex; this.pageModel.SelectToIndex=lastPageModel.SelectToIndex; this.pageModel.SelectSemesterIndex=lastPageModel.SelectSemesterIndex; >>>>>>> develmaster } privatevoidSetSelectedIndex() { this.Course.SelectedIndex=this.pageModel.SelectCourseIndex; this.Degree.SelectedIndex=this.pageModel.SelectDegreeIndex; this.Semester.SelectedIndex=this.pageModel.SelectSemesterIndex; this.From.SelectedIndex=this.pageModel.SelectFromIndex; this.To.SelectedIndex=this.pageModel.SelectToIndex; } privatevoidStoreSelectedIndex() { this.pageModel.SelectCourseIndex=this.Course.SelectedIndex; this.pageModel.SelectDegreeIndex=this.Degree.SelectedIndex; this.pageModel.SelectSemesterIndex=this.Semester.SelectedIndex; this.pageModel.SelectFromIndex=this.From.SelectedIndex; this.pageModel.SelectToIndex=this.To.SelectedIndex; } privatevoidSendRequest(objectsender,RoutedEventArgse) { <<<<<<< HEAD this.api=newLectureApi(); this.api.EventHandler.ApiIsReadyEvent+=newApiEventHandler.ApiReadyHandler(this.ApiIsReady); ======= this.api=newLectureApi(); this.api.EventHandler.ApiIsReadyEvent+=newApiEventHandler.ApiReadyHandler(this.ApiIsReady); >>>>>>> develmaster this.ProgressBar.Visibility=System.Windows.Visibility.Visible; List<UrlParamModel>parameterList=this.CreateUrlParameter(); this.api.ApiGet(parameterList); } privateList<UrlParamModel>CreateUrlParameter() { <<<<<<< HEAD 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; List<UrlParamModel>parameterList=newList<UrlParamModel>(); parameterList.Add(newUrlParamModel(Constants.ParamGetLecture_Semester,semester.Value)); parameterList.Add(newUrlParamModel(Constants.ParamGetLecture_Degree,degree.Value)); parameterList.Add(newUrlParamModel(Constants.ParamGetLecture_Course,course.Value)); parameterList.Add(newUrlParamModel(Constants.ParamGetLecture_From,from.Value)); parameterList.Add(newUrlParamModel(Constants.ParamGetLecture_To,to.Value)); ======= 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; List<UrlParamModel>parameterList=newList<UrlParamModel>(); parameterList.Add(newUrlParamModel(Constants.ParamGetLecture_Semester,semester.Value)); parameterList.Add(newUrlParamModel(Constants.ParamGetLecture_Degree,degree.Value)); parameterList.Add(newUrlParamModel(Constants.ParamGetLecture_Course,course.Value)); parameterList.Add(newUrlParamModel(Constants.ParamGetLecture_From,from.Value)); parameterList.Add(newUrlParamModel(Constants.ParamGetLecture_To,to.Value)); >>>>>>> develmaster returnparameterList; } privatevoidApiIsReady() { <<<<<<< HEAD App.SaveToIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel,this.api.Model); this.ProgressBar.Visibility=System.Windows.Visibility.Collapsed; Uriurl=newUri(Constants.PathLecture_ResultPage,UriKind.Relative); ======= App.SaveToIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel,this.api.Model); this.ProgressBar.Visibility=System.Windows.Visibility.Collapsed; Uriurl=newUri(Constants.PathLecture_ResultPage,UriKind.Relative); >>>>>>> develmaster NavigationService.Navigate(url); } #endregion #endregion } }