From 6dc522b6a80009cd986b78338722c1ec3961467f Mon Sep 17 00:00:00 2001 From: stubbfel Date: Thu, 11 Jul 2013 15:31:02 +0200 Subject: [PATCH 1/2] add listButtonstyle --- CampusAppWP8/CampusAppWP8/App.xaml | 13 ++++++++++--- CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 5 +++++ .../CampusAppWP8/Pages/Links/LinkPage.xaml | 7 ++++--- CampusAppWP8/CampusAppWP8/Resources/Icon1.ico | Bin 0 -> 10134 bytes .../CampusAppWP8/Styles/ListButton.xaml | 12 ++++++++++++ 5 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 CampusAppWP8/CampusAppWP8/Resources/Icon1.ico create mode 100644 CampusAppWP8/CampusAppWP8/Styles/ListButton.xaml diff --git a/CampusAppWP8/CampusAppWP8/App.xaml b/CampusAppWP8/CampusAppWP8/App.xaml index ada05b6a..57460a46 100644 --- a/CampusAppWP8/CampusAppWP8/App.xaml +++ b/CampusAppWP8/CampusAppWP8/App.xaml @@ -8,9 +8,16 @@ - - - + + + + + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 0c4c9e11..755f5d02 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -290,6 +290,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + @@ -350,6 +354,7 @@ PreserveNewest + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml index b1d94fc3..a5013c9f 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml @@ -1,4 +1,5 @@ - - + @@ -50,7 +51,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Resources/Icon1.ico b/CampusAppWP8/CampusAppWP8/Resources/Icon1.ico new file mode 100644 index 0000000000000000000000000000000000000000..e0e8a722f9000ab623c060d37518bddc63e626a8 GIT binary patch literal 10134 zcmZQzU}Rup5D*YxU}Run&|qX>NMm4N5D)-~b1-DEGBETp!uSdd87vG8-`E%!6cixp zUobH+#Bqc85cMlK7#Q66V0;CJ6#@(l@5C4wG(cuDFfb@EfYh-tfItI?z=|6f7(kK@ z4G@Z0i;J^U}28RD&#PI(=h{XUR|AU17|7YO;4+bCj%fSGN28ow{;4lBt z@xLBK|1balA4Ip8*MsT*F!BEoahUq=|Dp2#|CfW*gQV*jAm)F7(De)udp|HRG%%8g znHd-w*clia_!$@)40}?un5DH9!*dWZnz~JQM#1Ih?!O+s&%+S`>#?ar_$FP3g zdWKy)cQITzf1cs?&07r5o;+pv`2GXKw{PFT+DD1e5Eu=Cp&bJML4_R;3SeO1VMGEv zSoz#gz{m)Z=jP<#;NoWFhV!`@nLtWld`@OYMpkZaBzZP=ZWQ%gAmvE%U@n5s2vUu# zA0*Gn$jA(}AH?N`aFN^(l0|Yqgv)^NE;#b2Th4-NB?bluNVNnuADQ^}?c0BHFw6{) zUMDA~|D<4$9$M)C`2NFxd>H0NT=s+X-oAP3|Aq7C!T8yer(p9y`ap6Z8ieubhpCH* zhyd#a@nIOG7ld)?2ie`y+zb!P{=PmGGeCMl7?*ySJ?q!4|G#VJF1TKh9*`V}24O<_ zVg3f`LB=4xAWTR%p4;|3~oK%PY#i*CY7-2ngPy-NHhEghemmM zIYb)Hhf2fwP-zCJ<3M#g$apv(6c=CtyaY`52L=XqDr5c+3=Hxg7#Qq7Fff2(>i-7@ z#{VA}nE!uZV24@zA2ppr`z^@zDX7l^!bts=|NVKbifdW?m(vPH@0gF6}G(;Yx3x-jpG33#t(dE&l z88Gq(%wur>p{hWWhN>cuf;AYZ+(rSldB|v|fLi7Z3=IP0`DG;OBG7jN^%p6|_`-9r z*pJ-jq!t_IH)8xxEjy9T8LIZf#vaI_so{T+y~yU^V}sNpV`R1DhCj$Wm^nv}9Q~i1 zlnfsi1F=D3FnMIP$ZU{2HS7nCr-96!HFM^F5C*Y9Vj%ND7{mwBAdJig@u^{dUTz+I zEDvNp2!q5x=7TVZkBmWLFiZ{mD=R86><5X#>_D~~#D z1H?wgATb!G)P9&b$m6*nHcT8ugX{*;AdJig@u_7$$Sly9E^@jDiGeV(oycsE95w9+ zjZK5X9F+EuG00A246+x7DX|~fOj6h|yFv7*{gC+`QtMw>c!R + + \ No newline at end of file From ed891074e0658a8ea7c5cf218badd52a7c62d5af Mon Sep 17 00:00:00 2001 From: stubbfel Date: Thu, 11 Jul 2013 16:43:39 +0200 Subject: [PATCH 2/2] add listbuttonstyle to all pages --- .../Model/Events/RSSChannelModel.cs | 5 ++ .../CampusAppWP8/Model/Events/RSSModel.cs | 5 ++ .../Pages/Events/EventIndexPage.xaml | 16 +++++- .../Pages/Events/EventIndexPage.xaml.cs | 50 ++----------------- .../Pages/Lecture/ResultPage.xaml | 8 +-- .../Pages/Lecture/ResultPage.xaml.cs | 35 ------------- .../CampusAppWP8/Pages/Links/LinkPage.xaml | 5 +- .../Pages/News/NewsIndexPage.xaml | 16 +++++- .../Pages/News/NewsIndexPage.xaml.cs | 46 +---------------- .../Pages/Openinghours/OpeninghoursPage.xaml | 8 +-- .../Openinghours/OpeninghoursPage.xaml.cs | 34 ------------- .../StudentCouncil/StudentCouncilPage.xaml | 2 +- .../Resources/Constants.Designer.cs | 27 ++++++++++ .../CampusAppWP8/Resources/Constants.resx | 9 ++++ 14 files changed, 91 insertions(+), 175 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/Model/Events/RSSChannelModel.cs b/CampusAppWP8/CampusAppWP8/Model/Events/RSSChannelModel.cs index 2e8bc8aa..dc24d2e9 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Events/RSSChannelModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Events/RSSChannelModel.cs @@ -37,6 +37,11 @@ namespace CampusAppWP8.Model.events_news if (value != this.item) { this.item = value; + int i = 0; + foreach (RSSModel rssItem in this.item) + { + rssItem.Index = i++; + } NotifyPropertyChanged("item"); } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Events/RSSModel.cs b/CampusAppWP8/CampusAppWP8/Model/Events/RSSModel.cs index 19d53cb9..20833cfd 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Events/RSSModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Events/RSSModel.cs @@ -108,6 +108,11 @@ namespace CampusAppWP8.Model.events_news get { return String.Format("{0:h:mm} Uhr", this.timestamp); } } + /// + /// Gets or sets the ListIndex + /// + public int Index { get; set; } + /// /// Set/Get the link/url of the feed. /// diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml index 1c4b30c8..349a04cc 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml @@ -6,6 +6,7 @@ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 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" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -26,7 +27,20 @@ - + + + + + + + + + + + \ 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 78774169..086eda84 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs @@ -7,18 +7,12 @@ //----------------------------------------------------------------------------- namespace CampusAppWP8.Pages.Events { - using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; using System.Linq; - using System.Windows; - using System.Windows.Controls; using System.Windows.Navigation; using CampusAppWP8.Api.Events; - using CampusAppWP8.Model.events_news; using CampusAppWP8.Utility; using Microsoft.Phone.Controls; - + /// /// Overview page of all events. /// @@ -59,37 +53,13 @@ namespace CampusAppWP8.Pages.Events } /// - /// Is called after the RSS feeds are loaded into the eventFeed model. + /// 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 /// will be sorted by timestamp and the buttons will be created. /// private void SetupEventPageList() { - if ((EventIndexPage.eventFeed.Model != null) - && (EventIndexPage.eventFeed.Model.Channel != null) - && (EventIndexPage.eventFeed.Model.Channel.Count() >= 1) - && (this.ButtonPanel.Items.Count() == 0)) - { - // Sort the list of rssfeeds. - IEnumerable tempList = EventIndexPage.eventFeed.Model.Channel[0].item.OrderByDescending(e => e.DTTimestamp); - EventIndexPage.eventFeed.Model.Channel[0].item = new ObservableCollection(tempList); - - // Create the buttons for the fees selection and add it to the buttonpanel. - for (int i = 0; i < EventIndexPage.eventFeed.Model.Channel[0].item.Count(); i++) - { - Button tempBtn = new Button(); - tempBtn.Name = "EventRowAppButton"; - tempBtn.Content = EventIndexPage.eventFeed.Model.Channel[0].item[i].Title; - tempBtn.VerticalContentAlignment = VerticalAlignment.Stretch; - tempBtn.HorizontalContentAlignment = HorizontalAlignment.Stretch; - tempBtn.BorderThickness = new Thickness(0.0); - tempBtn.Padding = new Thickness(0.0); - tempBtn.Click += this.EventRowAppButton_Click; - tempBtn.Tag = i; - - this.ButtonPanel.Items.Add(tempBtn); - } - } + this.EventList.ItemsSource = EventIndexPage.eventFeed.Model.Channel[0].Item; } /// @@ -99,19 +69,5 @@ namespace CampusAppWP8.Pages.Events { get { return EventIndexPage.eventFeed; } } - - /// - /// Is called on clicking on a feed button. - /// Navigates to the event pivot page with the information of the - /// selected feed index. - /// - /// pressed button object - /// event args - private void EventRowAppButton_Click(object sender, RoutedEventArgs e) - { - FrameworkElement tempElem = sender as FrameworkElement; - - NavigationService.Navigate(new Uri("/pages/events/EventPage.xaml?pivotindex=" + tempElem.Tag, UriKind.Relative)); - } } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml index 496745b9..c480700a 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml @@ -36,7 +36,7 @@ - - + + - + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs index 6f490146..07e9eea7 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs @@ -21,12 +21,6 @@ namespace CampusAppWP8.Pages.Lecture /// public partial class ResultPage : PhoneApplicationPage { - - /// - /// last visible UI element. - /// - private UIElement lastOpenUIElem = null; - /// /// Initializes a new instance of the class. /// @@ -52,34 +46,5 @@ namespace CampusAppWP8.Pages.Lecture this.ResultList.ItemsSource = list.Activities; base.OnNavigatedTo(e); } - - /// - /// Method toggle the Visibility of the Link- and Details-Buttons - /// - /// Caller of the function - /// some EventArgs - private void ToggleOptions(object sender, RoutedEventArgs e) - { - if (this.lastOpenUIElem != null) - { - this.lastOpenUIElem.Visibility = Visibility.Collapsed; - } - - FrameworkElement btn = sender as FrameworkElement; - StackPanel parent = btn.Parent as StackPanel; - - if (parent.Children.Count() >= 2) - { - if (!parent.Children[1].Equals(this.lastOpenUIElem)) - { - this.lastOpenUIElem = parent.Children[1]; - this.lastOpenUIElem.Visibility = Visibility.Visible; - } - else - { - this.lastOpenUIElem = null; - } - } - } } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml index a5013c9f..f0378ecc 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml @@ -1,5 +1,4 @@ - - - + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml index 9457d700..9d7ab689 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml @@ -6,6 +6,7 @@ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 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" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -26,7 +27,20 @@ - + + + + + + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs index 7702f189..a00668fc 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs @@ -7,15 +7,9 @@ //----------------------------------------------------------------------------- namespace CampusAppWP8.Pages.News { - using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; using System.Linq; - using System.Windows; - using System.Windows.Controls; using System.Windows.Navigation; using CampusAppWP8.Api.News; - using CampusAppWP8.Model.events_news; using CampusAppWP8.Utility; using Microsoft.Phone.Controls; @@ -65,31 +59,7 @@ namespace CampusAppWP8.Pages.News /// private void SetupNewsPageList() { - if ((NewsIndexPage.newsFeed.Model != null) - && (NewsIndexPage.newsFeed.Model.Channel != null) - && (NewsIndexPage.newsFeed.Model.Channel.Count() >= 1) - && (this.ButtonPanel.Items.Count() == 0)) - { - // Sort the list of rssfeeds. - IEnumerable tempList = NewsIndexPage.newsFeed.Model.Channel[0].item.OrderByDescending(e => e.DTTimestamp); - NewsIndexPage.newsFeed.Model.Channel[0].item = new ObservableCollection(tempList); - - // Create the buttons for the fees selection and add it to the buttonpanel. - for (int i = 0; i < NewsIndexPage.newsFeed.Model.Channel[0].item.Count(); i++) - { - Button tempBtn = new Button(); - tempBtn.Name = "NewsRowAppButton"; - tempBtn.Content = NewsIndexPage.newsFeed.Model.Channel[0].item[i].Title; - tempBtn.VerticalContentAlignment = VerticalAlignment.Stretch; - tempBtn.HorizontalContentAlignment = HorizontalAlignment.Stretch; - tempBtn.BorderThickness = new Thickness(0.0); - tempBtn.Padding = new Thickness(0.0); - tempBtn.Click += this.NewsRowAppButton_Click; - tempBtn.Tag = i; - - this.ButtonPanel.Items.Add(tempBtn); - } - } + this.NewsList.ItemsSource = NewsIndexPage.newsFeed.Model.Channel[0].Item; } /// @@ -99,19 +69,5 @@ namespace CampusAppWP8.Pages.News { get { return NewsIndexPage.newsFeed; } } - - /// - /// Is called on clicking on a feed button. - /// Navigates to the news pivot page with the information of the - /// selected feed index. - /// - /// pressed button object - /// event args - private void NewsRowAppButton_Click(object sender, RoutedEventArgs e) - { - FrameworkElement tempElem = sender as FrameworkElement; - - NavigationService.Navigate(new Uri("/pages/news/NewsPage.xaml?pivotindex=" + tempElem.Tag, UriKind.Relative)); - } } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml index 398984cc..40dce836 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml @@ -38,8 +38,8 @@ - private OpeninghoursFeed feed = null; - /// - /// last visible UI element. - /// - private UIElement lastOpenUIElem = null; - #endregion #region Constructor @@ -103,35 +98,6 @@ namespace CampusAppWP8.Pages.Openinghours this.InstitutionPanel.ItemsSource = this.feed.Model.Institutions; } - /// - /// Called on clicking on a institution. - /// - /// button object - /// event args - private void InstitutionBtn_Click(object sender, RoutedEventArgs e) - { - if (this.lastOpenUIElem != null) - { - this.lastOpenUIElem.Visibility = Visibility.Collapsed; - } - - FrameworkElement btn = sender as FrameworkElement; - StackPanel parent = btn.Parent as StackPanel; - parent.Children.Count(); - if (parent.Children.Count() >= 2) - { - if (this.lastOpenUIElem != parent.Children[1]) - { - this.lastOpenUIElem = parent.Children[1]; - this.lastOpenUIElem.Visibility = Visibility.Visible; - } - else - { - this.lastOpenUIElem = null; - } - } - } - // private #endregion // Method diff --git a/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml index d495d996..6be59cd1 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml @@ -39,7 +39,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs index 0ce45221..68429a31 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs @@ -177,6 +177,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die pivotindex ähnelt. + /// + public static string ParamPivotIndex { + get { + return ResourceManager.GetString("ParamPivotIndex", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Url ähnelt. /// @@ -186,6 +195,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Events/EventPage.xaml ähnelt. + /// + public static string PathEvent_EventPage { + get { + return ResourceManager.GetString("PathEvent_EventPage", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Events/EventIndexPage.xaml ähnelt. /// @@ -267,6 +285,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die /pages/news/NewsPage.xaml ähnelt. + /// + public static string PathNews_NewsPage { + get { + return ResourceManager.GetString("PathNews_NewsPage", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Openinghours/OpeninghoursPage.xaml ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index 3920cc5c..8609e1be 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -216,4 +216,13 @@ ToggleContent + + pivotindex + + + /pages/news/NewsPage.xaml + + + /Pages/Events/EventPage.xaml + \ No newline at end of file