diff --git a/CampusAppWP8/CampusAppWP8/Assets/icons/DarkTheme/update_159.png b/CampusAppWP8/CampusAppWP8/Assets/icons/DarkTheme/update_159.png new file mode 100644 index 00000000..03ca56a6 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/icons/DarkTheme/update_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/icons/LightTheme/update_159.png b/CampusAppWP8/CampusAppWP8/Assets/icons/LightTheme/update_159.png new file mode 100644 index 00000000..24875146 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/icons/LightTheme/update_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 1fb528de..8a4bfa58 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -98,6 +98,7 @@ + @@ -204,11 +205,6 @@ True Constants.resx - - True - True - Icons.resx - @@ -338,6 +334,7 @@ + @@ -366,6 +363,7 @@ + @@ -404,8 +402,6 @@ Designer - PublicResXFileCodeGenerator - Icons.Designer.cs Designer diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml index 91c75427..692f5dec 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml @@ -43,4 +43,9 @@ + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs index d79cc557..ea0fe842 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs @@ -7,11 +7,14 @@ //----------------------------------------------------------------------------- namespace CampusAppWP8.Pages.Events { + using System; using System.Linq; using System.Windows.Navigation; using CampusAppWP8.Feed.Events; + using CampusAppWP8.Resources; using CampusAppWP8.Utility; using Microsoft.Phone.Controls; + using Microsoft.Phone.Shell; /// /// Overview page of all events. @@ -30,6 +33,12 @@ namespace CampusAppWP8.Pages.Events { this.InitializeComponent(); + ApplicationBarIconButton updateBtn = new ApplicationBarIconButton(); + updateBtn.IconUri = new Uri(Icons.Update, UriKind.Relative); + updateBtn.Text = AppResources.UpdateBtn; + updateBtn.Click += new EventHandler(this.EventForceUpdate_Click); + ApplicationBar.Buttons.Add(updateBtn); + if (EventIndexPage.eventFeed == null) { EventIndexPage.eventFeed = new EventFeed(false); @@ -66,5 +75,16 @@ namespace CampusAppWP8.Pages.Events { this.EventList.ItemsSource = EventIndexPage.eventFeed.Model.Channel[0].Item; } + + /// + /// On clicking the update button in the ApplicationBar. + /// Force a data update from the web. + /// + /// button object + /// event args + private void EventForceUpdate_Click(object sender, EventArgs e) + { + EventIndexPage.eventFeed.ForceWebUpdate(); + } } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml index 3a8919b5..ab82f293 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml @@ -55,7 +55,7 @@ - + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml index 16f279a4..436d168c 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml @@ -44,4 +44,8 @@ + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs index a7974800..36f6b63c 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs @@ -7,11 +7,12 @@ //----------------------------------------------------------------------------- namespace CampusAppWP8.Pages.News { - using System.Linq; + using System; using System.Windows.Navigation; using CampusAppWP8.Feed.News; - using CampusAppWP8.Utility; + using CampusAppWP8.Resources; using Microsoft.Phone.Controls; + using Microsoft.Phone.Shell; /// /// Overview page of all news. @@ -30,6 +31,12 @@ namespace CampusAppWP8.Pages.News { this.InitializeComponent(); + ApplicationBarIconButton updateBtn = new ApplicationBarIconButton(); + updateBtn.IconUri = new Uri(Icons.Update, UriKind.Relative); + updateBtn.Text = AppResources.UpdateBtn; + updateBtn.Click += new EventHandler(this.NewsForceUpdate_Click); + ApplicationBar.Buttons.Add(updateBtn); + if (NewsIndexPage.newsFeed == null) { NewsIndexPage.newsFeed = new NewsFeed(false); @@ -66,5 +73,16 @@ namespace CampusAppWP8.Pages.News { this.NewsList.ItemsSource = NewsIndexPage.newsFeed.Model.Channel[0].Item; } + + /// + /// On clicking the update button in the ApplicationBar. + /// Force a data update from the web. + /// + /// button object + /// event args + private void NewsForceUpdate_Click(object sender, EventArgs e) + { + NewsIndexPage.newsFeed.ForceWebUpdate(); + } } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml index 9a86fb16..e694bfad 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml @@ -54,7 +54,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs index ac03ffd4..a51dd3a1 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs @@ -645,6 +645,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Aktualisieren ähnelt. + /// + public static string UpdateBtn { + get { + return ResourceManager.GetString("UpdateBtn", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Willkommen zur BTU-CampusApp WP8 ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx index b7bf7b09..1272c78b 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx @@ -317,4 +317,7 @@ allg. Links + + Aktualisieren + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Icons.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Icons.Designer.cs index 76662380..f0fda48f 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Icons.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Icons.Designer.cs @@ -255,6 +255,17 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the update icon. + /// + public static string Update + { + get + { + return Themerize("Update"); + } + } + /// /// Return the theme depending string of a icon. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx index 50b43833..cc44f12f 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx @@ -165,6 +165,9 @@ student_council_159.png + + update_159.png + webmail_159.png