diff --git a/CampusAppWP8/CampusAppWP8/App.xaml.cs b/CampusAppWP8/CampusAppWP8/App.xaml.cs
index 00d78264..e0f3e904 100644
--- a/CampusAppWP8/CampusAppWP8/App.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/App.xaml.cs
@@ -91,6 +91,39 @@ namespace CampusAppWP8
}
return default(T);
}
+
+ ///
+ /// Method save any object to the IsolatedStorage
+ ///
+ /// key of the object
+ /// value of the object, if value == null => remove key
+ public static void SaveToAppState(string key, T value)
+ {
+ IsolatedStorageSettings isolatedStore = IsolatedStorageSettings.ApplicationSettings;
+ isolatedStore.Remove(key);
+ if (value != null)
+ {
+ isolatedStore.Add(key, value);
+ }
+
+ isolatedStore.Save();
+ }
+
+ ///
+ /// Method load any object to the IsolatedStorage
+ ///
+ /// key of the object
+ public static T LoadFromAppState(string key)
+ {
+ IsolatedStorageSettings isolatedStore = IsolatedStorageSettings.ApplicationSettings;
+
+ if (isolatedStore.Contains(key))
+ {
+ object value = isolatedStore[key];
+ return (T)value;
+ }
+ return default(T);
+ }
// Code, der beim Starten der Anwendung ausgeführt werden soll (z. B. über "Start")
// Dieser Code wird beim Reaktivieren der Anwendung nicht ausgeführt
private void Application_Launching(object sender, LaunchingEventArgs e)
diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs
index 32bbbbea..8f5b171e 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs
@@ -82,6 +82,12 @@ namespace CampusAppWP8.Model.Lecture
[XmlElement("modul")]
public LectureModule Modul { get; set; }
+ ///
+ /// Gets or sets LectureTitel
+ ///
+ [XmlElement("titel")]
+ public string Title { get; set; }
+
///
/// Gets or sets the lecturers
///
diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LecturePageModel.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LecturePageModel.cs
index bc87358d..ca79f582 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LecturePageModel.cs
+++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LecturePageModel.cs
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
-//
+//
// Company copyright tag.
//
// stubbfel
@@ -7,10 +7,15 @@
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
{
+ using System.Collections.Generic;
+ using System.Runtime.Serialization;
using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
- using System.Collections.Generic;
+ ///
+ /// Model for the LecturePage
+ ///
+ [DataContract]
public class LecturePageModel
{
#region Members
@@ -52,12 +57,39 @@ namespace CampusAppWP8.Model.Lecture
#region Proberty
+ ///
+ /// Gets or sets the selected course index
+ ///
+ [DataMember]
+ public int SelectCourseIndex { get; set; }
+
+ ///
+ /// Gets or sets the selected degree index
+ ///
+ [DataMember]
+ public int SelectDegreeIndex { get; set; }
+
+ ///
+ /// Gets or sets the selected semester-index
+ ///
+ [DataMember]
+ public int SelectSemesterIndex { get; set; }
+
+ ///
+ /// Gets or sets the selected from-index
+ ///
+ [DataMember]
+ public int SelectFromIndex { get; set; }
+
+ ///
+ /// Gets or sets the selected to-index
+ ///
+ [DataMember]
+ public int SelectToIndex { get; set; }
+
///
/// Gets List for the courses of the BTU
///
- ///
- /// need to be extend to full list
- ///
public List CourseList
{
get
@@ -105,7 +137,7 @@ namespace CampusAppWP8.Model.Lecture
#region public
///
- /// Load all ListpickerLists
+ /// Load all ListPickerLists
///
public void LoadLists()
{
@@ -162,6 +194,45 @@ namespace CampusAppWP8.Model.Lecture
this.courseList.Add(new ListPickerItemModel() { Text = "Architektur", Value = "013" });
this.courseList.Add(new ListPickerItemModel() { Text = "Bauingenieurwesen", Value = "017" });
this.courseList.Add(new ListPickerItemModel() { Text = "Betriebswirtschaftslehre", Value = "021" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Wirtschaftsrecht für Technologieunternehmen", Value = "042" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Elektrotechnik", Value = "048" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Informatik ", Value = "079" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Maschinenbau", Value = "104" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Mathematik", Value = "105" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Physik ", Value = "128" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Wirtschaftsingenieurwesen", Value = "179" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Wirtschaftswissenschaften ", Value = "184" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Biomedizinische Gerätetechnik ", Value = "215" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Verfahrenstechnik", Value = "226" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Wirtschaftsmathematik ", Value = "276" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Kultur und Technik ", Value = "711" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Physik der Halbleiter-Technologie", Value = "744" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Angewandte Mathematik ", Value = "749" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Technologie- und Innovationsmanagement", Value = "764" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Stadt- und Regionalplanung", Value = "766" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Informations- und Medientechnik ", Value = "767" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "World Heritage Studies", Value = "768" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Umweltingenieurwesen und Verfahrenstechnik", Value = "770" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Environmental and Resource Management", Value = "771" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Landnutzung und Wasserbewirtschaftung", Value = "772" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Bauen und Erhalten", Value = "773" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Umweltingenieurwesen", Value = "774" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "eBusiness", Value = "794" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Civil Engineering", Value = "798" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Structural Engineering", Value = "799" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Electrical Power Engineering ", Value = "800" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Euro Hydroinformatics and Water Management", Value = "841" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Technologien Biogener Rohstoffe", Value = "842" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Environmental Technologies", Value = "843" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Process Engineering and Plant Design", Value = "844" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Architekturvermittlung", Value = "845" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Nachwachsende Rohstoffe und Erneuerbare Energien", Value = "851" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Energieträger aus Biomasse und Abfällen", Value = "852" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Power Engineering", Value = "853" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Verfahrenstechnik - Prozess- und Anlagentechnik", Value = "857" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Architektur.Studium.Generale", Value = "858" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Verarbeitungstechnologien der Werkstoffe", Value = "860" });
+ this.courseList.Add(new ListPickerItemModel() { Text = "Forensic Sciences and Engineering", Value = "871" });
}
#endregion
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs
index 29c0b7f5..95c960be 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs
@@ -10,6 +10,7 @@ namespace CampusAppWP8.Pages.Lecture
using System;
using System.Collections.Generic;
using System.Windows;
+ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using CampusAppWP8.Feed.Lecture;
using CampusAppWP8.Model.Lecture;
@@ -17,14 +18,14 @@ namespace CampusAppWP8.Pages.Lecture
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using Microsoft.Phone.Controls;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
///
/// Class for the LecturePage
///
public partial class LecturePage : PhoneApplicationPage
{
+ #region Member
+
///
/// actual LectureAPI
///
@@ -38,6 +39,9 @@ namespace CampusAppWP8.Pages.Lecture
///
private LecturePageModel pageModel;
+ #endregion
+
+ #region Constructor
///
/// Initializes a new instance of the class.
///
@@ -48,10 +52,40 @@ namespace CampusAppWP8.Pages.Lecture
this.SetupListPickers();
if ((Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"] == Visibility.Visible)
{
- this.SearchButtonImg.Source = new BitmapImage(new Uri("/Assets/icons/search_159_dark.png",UriKind.Relative));
+ this.SearchButtonImg.Source = new BitmapImage(new Uri("/Assets/icons/search_159_dark.png", UriKind.Relative));
}
}
+ #endregion
+
+ #region methods
+
+ #region protected
+ ///
+ /// Methods overrides the OnNavigatedFrom-Method
+ ///
+ /// some NavigationEventArgs
+ protected override void OnNavigatedFrom(NavigationEventArgs e)
+ {
+ if (NavigationMode.Back == e.NavigationMode)
+ {
+ // delete all models
+ App.SaveToIsolatedStorage(Constants.IsolatedStorage_LecturePageModel, null);
+ App.SaveToIsolatedStorage(Constants.IsolatedStorage_LectureModel, null);
+ }
+ else
+ {
+ this.StoreSelectedIndex();
+ App.SaveToIsolatedStorage(Constants.IsolatedStorage_LecturePageModel, this.pageModel);
+ }
+
+ base.OnNavigatedFrom(e);
+ }
+
+ #endregion
+
+ #region private
+
///
/// Load the PageModel
///
@@ -60,16 +94,63 @@ namespace CampusAppWP8.Pages.Lecture
this.pageModel = new LecturePageModel();
this.pageModel.LoadLists();
}
+
///
/// Method sets the ItemSource of the ListPickers
///
private void SetupListPickers()
{
- this.Course.ItemsSource = pageModel.CourseList;
- this.Degree.ItemsSource = pageModel.DegreeList;
- this.From.ItemsSource = pageModel.NumberList;
- this.To.ItemsSource = pageModel.NumberList;
- this.Semester.ItemsSource = pageModel.SemesterList;
+ 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;
+
+ // load values from last request
+ LecturePageModel lastPageModel = App.LoadFromIsolatedStorage(Constants.IsolatedStorage_LecturePageModel);
+ if (lastPageModel != null)
+ {
+ this.SetLastSelectedIndex(lastPageModel);
+ }
+
+ this.SetSelectedIndex();
+ }
+
+ ///
+ /// Method set the last selected index of the ListPickers
+ ///
+ /// Last PageModel
+ private void SetLastSelectedIndex(LecturePageModel lastPageModel)
+ {
+ 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;
+ }
+
+ ///
+ /// Method set the last selected index of the ListPickers
+ ///
+ private void SetSelectedIndex()
+ {
+ 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;
+ }
+
+ ///
+ /// Method store the actual selectIndex to the models
+ ///
+ private void StoreSelectedIndex()
+ {
+ 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;
}
///
@@ -120,5 +201,9 @@ namespace CampusAppWP8.Pages.Lecture
Uri url = new Uri(Constants.PathLecture_ResultPage, UriKind.Relative);
NavigationService.Navigate(url);
}
+
+ #endregion
+
+ #endregion
}
}
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml
index 04b6ada9..dfea3521 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml
@@ -38,7 +38,7 @@
-
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml
index 187ffc38..cac704bf 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml
@@ -33,7 +33,7 @@
-
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs
index 6486db91..fbb9157a 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs
@@ -20,11 +20,6 @@ namespace CampusAppWP8.Pages.Lecture
///
public partial class ResultPage : PhoneApplicationPage
{
- ///
- /// Reference of the button which was lastClicked
- ///
- private Button lastClickedButton;
-
///
/// Initializes a new instance of the class.
///
@@ -39,8 +34,15 @@ namespace CampusAppWP8.Pages.Lecture
/// Arguments of navigation
protected override void OnNavigatedTo(NavigationEventArgs e)
{
- LectureList list = App.LoadFromIsolatedStorage(Constants.IsolatedStorage_LectureModel);
- this.ResultList.ItemsSource = list.Activities;
+ LectureList list = App.LoadFromIsolatedStorage(Constants.IsolatedStorage_LectureModel);
+ if (list == null)
+ {
+ Uri url = new Uri(Constants.PathLecture_LecturePage, UriKind.Relative);
+ NavigationService.Navigate(url);
+ return;
+ }
+
+ this.ResultList.ItemsSource = list.Activities;
base.OnNavigatedTo(e);
}
@@ -53,15 +55,14 @@ namespace CampusAppWP8.Pages.Lecture
{
Button button = (Button)sender;
StackPanel parent = (StackPanel)button.Parent;
- if (this.lastClickedButton != null && !this.lastClickedButton.Equals(button))
- {
- this.HideOptions(parent);
- }
- this.lastClickedButton = button;
-
Button link = (Button)parent.FindName("Link");
Button details = (Button)parent.FindName("Details");
+ if (link.Tag == null)
+ {
+ link.IsEnabled = false;
+ }
+
this.ToogleVisibility(link);
this.ToogleVisibility(details);
}
diff --git a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml
index b65e09d5..f4b319d3 100644
--- a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml
+++ b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
index f6d9df87..de490af5 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
+++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
@@ -69,6 +69,15 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die IsolatedStorage_LecturePageModel ähnelt.
+ ///
+ internal static string IsolatedStorage_LecturePageModel {
+ get {
+ return ResourceManager.GetString("IsolatedStorage_LecturePageModel", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die lsf_auszug ähnelt.
///
@@ -150,6 +159,15 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/LecturePage.xaml ähnelt.
+ ///
+ internal static string PathLecture_LecturePage {
+ get {
+ return ResourceManager.GetString("PathLecture_LecturePage", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/ModulWebPage.xaml ähnelt.
///
diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
index 3549c065..51ff2160 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
+++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
@@ -168,4 +168,10 @@
http://www.zv.tu-cottbus.de/LSFveranst/LSF4
+
+ IsolatedStorage_LecturePageModel
+
+
+ /Pages/Lecture/LecturePage.xaml
+
\ No newline at end of file