From 7bc55f6527106ec9528cceff68919edf1560b131 Mon Sep 17 00:00:00 2001 From: Christian Fiedler Date: Mon, 7 Oct 2013 17:13:29 +0200 Subject: [PATCH 01/11] DefaultHeader --- CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 7 ++ .../Pages/News/NewsIndexPage.xaml | 4 ++ .../Utility/Lui/Header/DefaultHeader.xaml | 12 ++++ .../Utility/Lui/Header/DefaultHeader.xaml.cs | 66 +++++++++++++++++++ 4 files changed, 89 insertions(+) create mode 100644 CampusAppWP8/CampusAppWP8/Utility/Lui/Header/DefaultHeader.xaml create mode 100644 CampusAppWP8/CampusAppWP8/Utility/Lui/Header/DefaultHeader.xaml.cs diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 79c3aa26..f2216b62 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -157,6 +157,9 @@ + + DefaultHeader.xaml + @@ -401,6 +404,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml index 1376bfb3..c2efe61e 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml @@ -7,6 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button" + xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -23,10 +24,13 @@ + + diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Header/DefaultHeader.xaml b/CampusAppWP8/CampusAppWP8/Utility/Lui/Header/DefaultHeader.xaml new file mode 100644 index 00000000..44b69bbf --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Header/DefaultHeader.xaml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Header/DefaultHeader.xaml.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Header/DefaultHeader.xaml.cs new file mode 100644 index 00000000..640579cb --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Header/DefaultHeader.xaml.cs @@ -0,0 +1,66 @@ +//----------------------------------------------------------------------------- +// +// Company copyright tag. +// +// fiedlchr +// 07.10.2013 +//----------------------------------------------------------------------------- +namespace CampusAppWP8.Utility.Lui.Header +{ + using System.Windows; + using System.Windows.Controls; + using CampusAppWP8.Resources; + + /// + /// Default Header Template. + /// + public partial class DefaultHeader : UserControl + { + /// AppTitle property object. + public static readonly DependencyProperty AppTitleProperty = DependencyProperty.Register("AppTitle", typeof(string), typeof(DefaultHeader), new PropertyMetadata(null)); + + /// HeaderName property object. + public static readonly DependencyProperty HeaderNameProperty = DependencyProperty.Register("HeaderName", typeof(string), typeof(DefaultHeader), new PropertyMetadata(null)); + + /// + /// Initializes a new instance of the class. + /// + public DefaultHeader() + { + this.InitializeComponent(); + this.AppTitle = AppResources.ApplicationTitle; + } + + /// + /// Gets or sets the AppTitle property. + /// + public string AppTitle + { + get + { + return (string)this.GetValue(AppTitleProperty); + } + + set + { + this.SetValue(AppTitleProperty, value); + } + } + + /// + /// Gets or sets the HeaderName property. + /// + public string HeaderName + { + get + { + return (string)this.GetValue(HeaderNameProperty); + } + + set + { + this.SetValue(HeaderNameProperty, value); + } + } + } +} \ No newline at end of file From 4264e1fcd3657022dd8a718d93d47484c877650f Mon Sep 17 00:00:00 2001 From: Christian Fiedler Date: Mon, 7 Oct 2013 19:00:41 +0200 Subject: [PATCH 02/11] nearly done --- .../Pages/Events/EventIndexPage.xaml | 14 ++++++++++++- .../Pages/Events/EventIndexPage.xaml.cs | 20 +++++++++++++++++++ .../CampusAppWP8/Pages/Events/EventPage.xaml | 6 +++--- .../Pages/Events/EventPage.xaml.cs | 2 +- .../Pages/News/NewsIndexPage.xaml | 10 +++++++++- .../Pages/News/NewsIndexPage.xaml.cs | 20 +++++++++++++++++++ .../CampusAppWP8/Pages/News/NewsPage.xaml | 6 +++--- .../CampusAppWP8/Pages/News/NewsPage.xaml.cs | 18 +++++++++++++++++ 8 files changed, 87 insertions(+), 9 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml index 0aac8c25..059d98f6 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml @@ -7,6 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button" + xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -23,10 +24,13 @@ + + @@ -39,7 +43,15 @@ - + + + + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs index 73f8b349..b9ec7697 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs @@ -125,6 +125,26 @@ namespace CampusAppWP8.Pages.Events base.OnNavigatedFrom(e); } + /// + /// Methods overrides the OnOrientationChanged-Method. + /// + /// orientation changed event args. + protected override void OnOrientationChanged(OrientationChangedEventArgs e) + { + if (e.Orientation == PageOrientation.Landscape + || e.Orientation == PageOrientation.LandscapeLeft + || e.Orientation == PageOrientation.LandscapeRight) + { + ApplicationBar.Mode = ApplicationBarMode.Default; + } + else + { + ApplicationBar.Mode = ApplicationBarMode.Minimized; + } + + base.OnOrientationChanged(e); + } + #endregion #region private diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml index fbc0b384..b8d10f80 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml @@ -34,13 +34,13 @@ - + - + - + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs index c2b20c99..e13fbe5c 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs @@ -21,7 +21,7 @@ namespace CampusAppWP8.Pages.Events using CampusAppWPortalLib8.Model.RSS; /// - /// EventPage, where every event fees has his own PivotItem. + /// EventPage, where every event feed has his own PivotItem. /// public partial class EventPage : PhoneApplicationPage { diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml index c2efe61e..dad5a881 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml @@ -43,7 +43,15 @@ - + + + + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs index 69814293..06b0ca9a 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs @@ -125,6 +125,26 @@ namespace CampusAppWP8.Pages.News #region private + /// + /// Methods overrides the OnOrientationChanged-Method. + /// + /// orientation changed event args. + protected override void OnOrientationChanged(OrientationChangedEventArgs e) + { + if (e.Orientation == PageOrientation.LandscapeRight + || e.Orientation == PageOrientation.LandscapeLeft + || e.Orientation == PageOrientation.Landscape) + { + ApplicationBar.Mode = ApplicationBarMode.Default; + } + else + { + ApplicationBar.Mode = ApplicationBarMode.Minimized; + } + + base.OnOrientationChanged(e); + } + /// /// Is called after the RSS feeds are loaded into the newsFeed model. /// If there was no feed information set to the UI, the feed list diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml index 85e6faf4..281eaf5d 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml @@ -33,13 +33,13 @@ - + - + - + diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml.cs index 1c5556d2..b0242c94 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml.cs @@ -150,6 +150,24 @@ namespace CampusAppWP8.Pages.News } } + /* + protected override void OnOrientationChanged(OrientationChangedEventArgs e) + { + if (e.Orientation == PageOrientation.Landscape + || e.Orientation == PageOrientation.LandscapeLeft + || e.Orientation == PageOrientation.LandscapeRight) + { + ApplicationBar.Mode = ApplicationBarMode.Default; + } + else + { + ApplicationBar.Mode = ApplicationBarMode.Minimized; + } + + base.OnOrientationChanged(e); + } + */ + /// /// Called when the index of the selected PivotItem is changed. /// Set the text Grid to visible and the WebBrowser to collapsed. From 577b2fd061af59ae6a3f43d8a134e6a1397a6f69 Mon Sep 17 00:00:00 2001 From: Christian Fiedler Date: Mon, 7 Oct 2013 19:01:31 +0200 Subject: [PATCH 03/11] nearly done --- .../CampusAppWPortalLib8/Model/RSS/RSSModel.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/RSS/RSSModel.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/RSS/RSSModel.cs index 22f79ca1..32b6afb7 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Model/RSS/RSSModel.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Model/RSS/RSSModel.cs @@ -135,6 +135,18 @@ namespace CampusAppWPortalLib8.Model.RSS } } + /// + /// Gets the date of the timestamp as string. + /// example: 25.06. + /// + public string ShortDate + { + get + { + return string.Format("{0:dd.MM.}", this.timestamp); + } + } + /// /// Gets the time of the timestamp as string. /// example: 12:56. From 92097cf881a591e6d4e208a3cc793768e6dfee45 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Tue, 8 Oct 2013 11:17:06 +0200 Subject: [PATCH 04/11] add header to userprofil --- .../CampusAppWP8/Pages/Setting/UserProfil.xaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml b/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml index 421e235e..69874c2e 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml @@ -7,6 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" + xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -22,12 +23,11 @@ - - - - - + + + + From 0f3bbc3cf6cbc8f9de074a27af3db9feb8975d77 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Tue, 8 Oct 2013 12:09:25 +0200 Subject: [PATCH 05/11] fix personpage --- .../Model/Person/PersonListWp8Model.cs | 21 +++++++++++++++ .../CampusAppWP8/Pages/Person/PersonPage.xaml | 19 +++++++------- .../Pages/Person/PersonPage.xaml.cs | 16 +++++++++++- .../Model/Person/PersonListModel.cs | 26 +++---------------- 4 files changed, 48 insertions(+), 34 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs index 474f3fea..4a95dcb9 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs @@ -10,6 +10,7 @@ namespace CampusAppWP8.Model.Person { using System.Xml.Serialization; using CampusAppWPortalLib8.Model.Person; + using System.Collections.Generic; /// Person list model. /// Stubbfel, 05.09.2013. @@ -25,5 +26,25 @@ namespace CampusAppWP8.Model.Person IPersonModel tmpPerson = base.GetPerson(id); return tmpPerson as PersonWp8Model; } + + + /// Removes the non function person. + /// Stubbfel, 05.09.2013. + public override void RemoveNonFunctionPerson() + { + List removeList = new List(); + foreach (PersonWp8Model tmpPerson in this.Persons) + { + if (tmpPerson.Functions.Count < 1) + { + removeList.Add(tmpPerson); + } + } + + foreach (PersonWp8Model removePerson in removeList) + { + this.Persons.Remove(removePerson); + } + } } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml index bfc4d4ca..7564bfa0 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml @@ -7,6 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button" + xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -21,12 +22,10 @@ - - - - - + + + @@ -46,7 +45,7 @@ - + @@ -105,10 +104,10 @@ - - - - + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs index ac47c1e4..6681f537 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs @@ -8,8 +8,8 @@ namespace CampusAppWP8.Pages.Person { - using System.Collections.Generic; using System.Windows; + using System.Windows.Input; using CampusAppWP8.Api.Person; using CampusAppWP8.Model.Person; using CampusAppWP8.Resources; @@ -18,6 +18,7 @@ namespace CampusAppWP8.Pages.Person using CampusAppWPortalLib8.Model.Utility; using Microsoft.Phone.Controls; using Microsoft.Phone.Tasks; + using System.Collections.Generic; /// Person page. /// Stubbfel, 09.09.2013. @@ -97,6 +98,10 @@ namespace CampusAppWP8.Pages.Person { this.api.Model.RemoveNonFunctionAndSetIdsPerson(); this.ResultBox.ItemsSource = this.api.Model.Persons; + if (this.api.Model == null || this.api.Model.Persons == null || this.api.Model.Persons.Count < 1) + { + MessageBoxes.ShowMainModelInfoMessageBox(AppResources.MsgBox_NoResult); + } } /// Event handler. Called by Button for click events. @@ -138,6 +143,15 @@ namespace CampusAppWP8.Pages.Person saveContactTask.Show(); } + private void SearchName_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) + { + if (e.Key == Key.Enter) + { + this.SendRequest(sender,e); + } + } + #endregion + } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonListModel.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonListModel.cs index d79729a8..ade93416 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonListModel.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonListModel.cs @@ -16,7 +16,7 @@ namespace CampusAppWPortalLib8.Model.Person /// Stubbfel, 05.09.2013. /// personModel template [XmlRoot("Uebersicht")] - public class PersonListModel + public abstract class PersonListModel { #region Property @@ -76,28 +76,8 @@ namespace CampusAppWPortalLib8.Model.Person /// Removes the non function person. /// Stubbfel, 05.09.2013. - public void RemoveNonFunctionPerson() - { - List removeList = new List(); - foreach (T item in this.Persons) - { - IPersonModel tmpPerson = item as IPersonModel; - if (tmpPerson == null) - { - continue; - } - - if (tmpPerson.Functions.Count < 1) - { - removeList.Add(item); - } - } - - foreach (T removePerson in removeList) - { - this.Persons.Remove(removePerson); - } - } + public abstract void RemoveNonFunctionPerson(); + #endregion } From f9c2f95ea5838dca28e93e5f7a54a4765f608538 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Tue, 8 Oct 2013 12:50:04 +0200 Subject: [PATCH 06/11] finish 230 --- .../CampusAppWP8/Pages/Exams/Exams.xaml | 31 ++++++++++++++----- .../CampusAppWP8/Pages/Exams/Exams.xaml.cs | 3 ++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml b/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml index b46de0a3..66530d29 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml @@ -7,6 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button" + xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -16,9 +17,23 @@ - - - + + + + + + + + + + + + + + + + +