From e60bfae1a855027a2b9f574dd5eb23e513660ebc Mon Sep 17 00:00:00 2001 From: stubbfel Date: Mon, 8 Jul 2013 14:12:45 +0200 Subject: [PATCH 1/3] add Navbutton anud add Constatn.rex to global --- CampusAppWP8/CampusAppWP8/App.xaml | 1 + CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 4 +- CampusAppWP8/CampusAppWP8/Constantes.cs | 14 ++++ .../Resources/Constants.Designer.cs | 70 ++++++++--------- .../Utility/Lui/Button/NavigateButton.cs | 75 +++++++++++++++++++ .../CampusAppWP8/pages/StartPage.xaml | 5 +- 6 files changed, 131 insertions(+), 38 deletions(-) create mode 100644 CampusAppWP8/CampusAppWP8/Constantes.cs create mode 100644 CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs diff --git a/CampusAppWP8/CampusAppWP8/App.xaml b/CampusAppWP8/CampusAppWP8/App.xaml index eb834714..ada05b6a 100644 --- a/CampusAppWP8/CampusAppWP8/App.xaml +++ b/CampusAppWP8/CampusAppWP8/App.xaml @@ -10,6 +10,7 @@ + diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 4dccd3c1..0f78c338 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -96,6 +96,7 @@ App.xaml + @@ -210,6 +211,7 @@ + @@ -359,7 +361,7 @@ Designer - ResXFileCodeGenerator + PublicResXFileCodeGenerator Constants.Designer.cs diff --git a/CampusAppWP8/CampusAppWP8/Constantes.cs b/CampusAppWP8/CampusAppWP8/Constantes.cs new file mode 100644 index 00000000..294f83d0 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Constantes.cs @@ -0,0 +1,14 @@ +using CampusAppWP8.Resources; + +namespace CampusAppWP8 +{ + /// + /// Bietet Zugriff auf Zeichenfolgenressourcen. + /// + public class Const + { + private static Constants _localizedResources = new Constants(); + + public Constants Constants { get { return _localizedResources; } } + } +} \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs index 1131614c..3a0c91cb 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs @@ -22,7 +22,7 @@ namespace CampusAppWP8.Resources { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Constants { + public class Constants { private static global::System.Resources.ResourceManager resourceMan; @@ -36,7 +36,7 @@ namespace CampusAppWP8.Resources { /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CampusAppWP8.Resources.Constants", typeof(Constants).Assembly); @@ -51,7 +51,7 @@ namespace CampusAppWP8.Resources { /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,7 +63,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die ClubLinks.xml ähnelt. /// - internal static string FileLink_ClubLinks { + public static string FileLink_ClubLinks { get { return ResourceManager.GetString("FileLink_ClubLinks", resourceCulture); } @@ -72,7 +72,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die CommonLinks.xml ähnelt. /// - internal static string FileLink_CommonLinks { + public static string FileLink_CommonLinks { get { return ResourceManager.GetString("FileLink_CommonLinks", resourceCulture); } @@ -81,7 +81,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die StudentCouncils.xml ähnelt. /// - internal static string FileStudentCouncil_StudentCouncils { + public static string FileStudentCouncil_StudentCouncils { get { return ResourceManager.GetString("FileStudentCouncil_StudentCouncils", resourceCulture); } @@ -90,7 +90,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die LectureModel ähnelt. /// - internal static string IsolatedStorage_LectureModel { + public static string IsolatedStorage_LectureModel { get { return ResourceManager.GetString("IsolatedStorage_LectureModel", resourceCulture); } @@ -99,7 +99,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die IsolatedStorage_LecturePageModel ähnelt. /// - internal static string IsolatedStorage_LecturePageModel { + public static string IsolatedStorage_LecturePageModel { get { return ResourceManager.GetString("IsolatedStorage_LecturePageModel", resourceCulture); } @@ -108,7 +108,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die lsf_auszug ähnelt. /// - internal static string LectureXmlValidRootName { + public static string LectureXmlValidRootName { get { return ResourceManager.GetString("LectureXmlValidRootName", resourceCulture); } @@ -117,7 +117,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die Studiengang ähnelt. /// - internal static string ParamGetLecture_Course { + public static string ParamGetLecture_Course { get { return ResourceManager.GetString("ParamGetLecture_Course", resourceCulture); } @@ -126,7 +126,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die Abschluss ähnelt. /// - internal static string ParamGetLecture_Degree { + public static string ParamGetLecture_Degree { get { return ResourceManager.GetString("ParamGetLecture_Degree", resourceCulture); } @@ -135,7 +135,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die Von ähnelt. /// - internal static string ParamGetLecture_From { + public static string ParamGetLecture_From { get { return ResourceManager.GetString("ParamGetLecture_From", resourceCulture); } @@ -144,7 +144,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die Semester ähnelt. /// - internal static string ParamGetLecture_Semester { + public static string ParamGetLecture_Semester { get { return ResourceManager.GetString("ParamGetLecture_Semester", resourceCulture); } @@ -153,7 +153,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die Bis ähnelt. /// - internal static string ParamGetLecture_To { + public static string ParamGetLecture_To { get { return ResourceManager.GetString("ParamGetLecture_To", resourceCulture); } @@ -162,7 +162,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die ActivityId ähnelt. /// - internal static string ParamModelLecture_ActivityId { + public static string ParamModelLecture_ActivityId { get { return ResourceManager.GetString("ParamModelLecture_ActivityId", resourceCulture); } @@ -171,7 +171,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die ModulNumber ähnelt. /// - internal static string ParamModelLecture_ModulNumber { + public static string ParamModelLecture_ModulNumber { get { return ResourceManager.GetString("ParamModelLecture_ModulNumber", resourceCulture); } @@ -180,7 +180,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die Url ähnelt. /// - internal static string ParamUrl { + public static string ParamUrl { get { return ResourceManager.GetString("ParamUrl", resourceCulture); } @@ -189,7 +189,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Events/EventIndexPage.xaml ähnelt. /// - internal static string PathEvents_EventsIndexPage { + public static string PathEvents_EventsIndexPage { get { return ResourceManager.GetString("PathEvents_EventsIndexPage", resourceCulture); } @@ -198,7 +198,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/LecturePage.xaml ähnelt. /// - internal static string PathLecture_LecturePage { + public static string PathLecture_LecturePage { get { return ResourceManager.GetString("PathLecture_LecturePage", resourceCulture); } @@ -207,7 +207,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/ModulWebPage.xaml ähnelt. /// - internal static string PathLecture_ModulWebPage { + public static string PathLecture_ModulWebPage { get { return ResourceManager.GetString("PathLecture_ModulWebPage", resourceCulture); } @@ -216,7 +216,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/ResultDetailPage.xaml ähnelt. /// - internal static string PathLecture_ResultDetailPage { + public static string PathLecture_ResultDetailPage { get { return ResourceManager.GetString("PathLecture_ResultDetailPage", resourceCulture); } @@ -225,7 +225,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/ResultPage.xaml ähnelt. /// - internal static string PathLecture_ResultPage { + public static string PathLecture_ResultPage { get { return ResourceManager.GetString("PathLecture_ResultPage", resourceCulture); } @@ -234,7 +234,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Links/LinkPage.xaml ähnelt. /// - internal static string PathLinks_LinkPage { + public static string PathLinks_LinkPage { get { return ResourceManager.GetString("PathLinks_LinkPage", resourceCulture); } @@ -243,7 +243,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Webmail/WebmailPage.xaml ähnelt. /// - internal static string PathMail_WebMailPage { + public static string PathMail_WebMailPage { get { return ResourceManager.GetString("PathMail_WebMailPage", resourceCulture); } @@ -252,7 +252,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Mensa/MensaPage.xaml ähnelt. /// - internal static string PathMensa_MensaPage { + public static string PathMensa_MensaPage { get { return ResourceManager.GetString("PathMensa_MensaPage", resourceCulture); } @@ -261,7 +261,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/News/NewsIndexPage.xaml ähnelt. /// - internal static string PathNews_NewsIndexPage { + public static string PathNews_NewsIndexPage { get { return ResourceManager.GetString("PathNews_NewsIndexPage", resourceCulture); } @@ -270,7 +270,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Openinghours/OpeninghoursPage.xaml ähnelt. /// - internal static string PathOpeninghours_OpeninghoursPage { + public static string PathOpeninghours_OpeninghoursPage { get { return ResourceManager.GetString("PathOpeninghours_OpeninghoursPage", resourceCulture); } @@ -279,7 +279,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/StudentCouncil/StudentCouncilPage.xaml ähnelt. /// - internal static string PathStudentCouncil_StudentCouncilPage { + public static string PathStudentCouncil_StudentCouncilPage { get { return ResourceManager.GetString("PathStudentCouncil_StudentCouncilPage", resourceCulture); } @@ -288,7 +288,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die http://www.zv.tu-cottbus.de/LSFveranst/LSF4 ähnelt. /// - internal static string UrlLecture_ApiBaseAddr { + public static string UrlLecture_ApiBaseAddr { get { return ResourceManager.GetString("UrlLecture_ApiBaseAddr", resourceCulture); } @@ -297,7 +297,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die https://www.tu-cottbus.de/modul/ ähnelt. /// - internal static string UrlLecture_ModulBaseAddr { + public static string UrlLecture_ModulBaseAddr { get { return ResourceManager.GetString("UrlLecture_ModulBaseAddr", resourceCulture); } @@ -306,7 +306,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=clubs&app=2&appversion=1 ähnelt. /// - internal static string UrlLink_ClubLinks { + public static string UrlLink_ClubLinks { get { return ResourceManager.GetString("UrlLink_ClubLinks", resourceCulture); } @@ -315,7 +315,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=links&app=2&appversion=1 ähnelt. /// - internal static string UrlLink_CommonLinks { + public static string UrlLink_CommonLinks { get { return ResourceManager.GetString("UrlLink_CommonLinks", resourceCulture); } @@ -324,7 +324,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=studentcouncils&app=2&appversion=1 ähnelt. /// - internal static string UrlStudentCouncil_StudentCouncils { + public static string UrlStudentCouncil_StudentCouncils { get { return ResourceManager.GetString("UrlStudentCouncil_StudentCouncils", resourceCulture); } @@ -333,7 +333,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die https://webmail.tu-cottbus.de ähnelt. /// - internal static string UrlWebMail_Addr { + public static string UrlWebMail_Addr { get { return ResourceManager.GetString("UrlWebMail_Addr", resourceCulture); } @@ -342,7 +342,7 @@ namespace CampusAppWP8.Resources { /// /// Sucht eine lokalisierte Zeichenfolge, die root ähnelt. /// - internal static string XMLRootElementName { + public static string XMLRootElementName { get { return ResourceManager.GetString("XMLRootElementName", resourceCulture); } diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs new file mode 100644 index 00000000..23d8b2c4 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs @@ -0,0 +1,75 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 08.07.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Utility.Lui.Button +{ + using System; + using System.Windows; + using System.Windows.Controls; + using System.Windows.Media.Imaging; + using CampusAppWP8.Resources; + using Microsoft.Phone.Tasks; + using System.Windows.Navigation; + using Microsoft.Phone.Controls; + + /// + /// This class create an Button which start the WebBrowser, which an certain url + /// + public class NavigateButton : System.Windows.Controls.Button + { + #region Members + + /// + /// Register the EmailProperty + /// + public static readonly DependencyProperty NavigateProperty = DependencyProperty.Register("Url", typeof(object), typeof(NavigateButton), new PropertyMetadata(false)); + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public NavigateButton() + : base() + { + + } + + #endregion + + #region Proberties + + /// + /// Gets or sets the Url + /// + public object Url + { + get { return (object)this.GetValue(NavigateProperty); } + set { this.SetValue(NavigateProperty, value); } + } + + #endregion + + #region Methods + + /// + /// Overrides the OnClick-Method from button + /// + /// + /// now method navigate to a certainpage + /// + protected override void OnClick() + { + Uri url = new Uri(this.Url as string, UriKind.Relative); + Page page = App.RootFrame.Content as Page; + page.NavigationService.Navigate(url); + } + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml b/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml index dea9fd69..1436b53f 100644 --- a/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml +++ b/CampusAppWP8/CampusAppWP8/pages/StartPage.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}" @@ -122,12 +123,12 @@ - + From c3a572c6f642b7de675c186e2be2ff3eb366b30d Mon Sep 17 00:00:00 2001 From: stubbfel Date: Mon, 8 Jul 2013 15:29:01 +0200 Subject: [PATCH 2/3] add Qurreystring to navbtn #85 --- CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 2 +- CampusAppWP8/CampusAppWP8/Const.cs | 33 +++++++ CampusAppWP8/CampusAppWP8/Constantes.cs | 14 --- .../Pages/Lecture/ResultPage.xaml | 69 +++++++------- .../Pages/Lecture/ResultPage.xaml.cs | 12 --- .../Utility/Lui/Button/NavigateButton.cs | 44 +++++++-- .../CampusAppWP8/pages/StartPage.xaml | 46 +++++----- .../CampusAppWP8/pages/StartPage.xaml.cs | 91 ------------------- 8 files changed, 129 insertions(+), 182 deletions(-) create mode 100644 CampusAppWP8/CampusAppWP8/Const.cs delete mode 100644 CampusAppWP8/CampusAppWP8/Constantes.cs diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 0f78c338..66a85f19 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -96,7 +96,7 @@ App.xaml - + diff --git a/CampusAppWP8/CampusAppWP8/Const.cs b/CampusAppWP8/CampusAppWP8/Const.cs new file mode 100644 index 00000000..57cfe428 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Const.cs @@ -0,0 +1,33 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 08.07.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8 +{ + using CampusAppWP8.Resources; + + /// + /// Access to Constants.rex + /// + public class Const + { + /// + /// Resource object. + /// + private static Constants constantResources = new Constants(); + + /// + /// Gets the resource object. + /// + public Constants Constants + { + get + { + return constantResources; + } + } + } +} \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Constantes.cs b/CampusAppWP8/CampusAppWP8/Constantes.cs deleted file mode 100644 index 294f83d0..00000000 --- a/CampusAppWP8/CampusAppWP8/Constantes.cs +++ /dev/null @@ -1,14 +0,0 @@ -using CampusAppWP8.Resources; - -namespace CampusAppWP8 -{ - /// - /// Bietet Zugriff auf Zeichenfolgenressourcen. - /// - public class Const - { - private static Constants _localizedResources = new Constants(); - - public Constants Constants { get { return _localizedResources; } } - } -} \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml index 2f369ed6..496745b9 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.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}" @@ -25,39 +26,41 @@ - - - - - - - - - - + + + + + - - - - + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs index 597812ed..a5256d6b 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs @@ -94,17 +94,5 @@ namespace CampusAppWP8.Pages.Lecture Uri url = new Uri(Constants.PathLecture_ModulWebPage + "?" + Constants.ParamModelLecture_ModulNumber + "=" + btn.Tag, UriKind.Relative); NavigationService.Navigate(url); } - - /// - /// Method navigate to DetailPage - /// - /// Caller of the function - /// some EventArgs - private void ShowDetailPage(object sender, RoutedEventArgs e) - { - Button btn = (Button)sender; - Uri url = new Uri(Constants.PathLecture_ResultDetailPage + "?" + Constants.ParamModelLecture_ActivityId + "=" + btn.Tag, UriKind.Relative); - NavigationService.Navigate(url); - } } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs index 23d8b2c4..5f76143f 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs @@ -10,11 +10,6 @@ namespace CampusAppWP8.Utility.Lui.Button using System; using System.Windows; using System.Windows.Controls; - using System.Windows.Media.Imaging; - using CampusAppWP8.Resources; - using Microsoft.Phone.Tasks; - using System.Windows.Navigation; - using Microsoft.Phone.Controls; /// /// This class create an Button which start the WebBrowser, which an certain url @@ -28,6 +23,16 @@ namespace CampusAppWP8.Utility.Lui.Button /// public static readonly DependencyProperty NavigateProperty = DependencyProperty.Register("Url", typeof(object), typeof(NavigateButton), new PropertyMetadata(false)); + /// + /// Register the EmailProperty + /// + public static readonly DependencyProperty QueryValueProperty = DependencyProperty.Register("QuerryStringValue", typeof(object), typeof(NavigateButton), new PropertyMetadata(false)); + + /// + /// Register the EmailProperty + /// + public static readonly DependencyProperty QueryNameProperty = DependencyProperty.Register("QuerryStringName", typeof(object), typeof(NavigateButton), new PropertyMetadata(false)); + #endregion #region Constructors @@ -38,7 +43,6 @@ namespace CampusAppWP8.Utility.Lui.Button public NavigateButton() : base() { - } #endregion @@ -54,6 +58,24 @@ namespace CampusAppWP8.Utility.Lui.Button set { this.SetValue(NavigateProperty, value); } } + /// + /// Gets or sets the Url + /// + public object QuerryStringName + { + get { return (object)this.GetValue(QueryNameProperty); } + set { this.SetValue(QueryNameProperty, value); } + } + + /// + /// Gets or sets the Url + /// + public object QuerryStringValue + { + get { return (object)this.GetValue(QueryValueProperty); } + set { this.SetValue(QueryValueProperty, value); } + } + #endregion #region Methods @@ -62,11 +84,17 @@ namespace CampusAppWP8.Utility.Lui.Button /// Overrides the OnClick-Method from button /// /// - /// now method navigate to a certainpage + /// now method navigate to a certain page /// protected override void OnClick() { - Uri url = new Uri(this.Url as string, UriKind.Relative); + string urlString = this.Url as string; + + if (this.QuerryStringName != null && this.QuerryStringValue != null) + { + urlString += "?" + this.QuerryStringName + "=" + this.QuerryStringValue; + } + Uri url = new Uri(urlString as string, UriKind.Relative); Page page = App.RootFrame.Content as Page; page.NavigationService.Navigate(url); } diff --git a/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml b/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml index 1436b53f..2e284353 100644 --- a/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml +++ b/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml @@ -43,87 +43,87 @@ - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml.cs b/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml.cs index ee7a5538..f5cc8301 100644 --- a/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml.cs @@ -25,9 +25,6 @@ namespace CampusAppWP8.Pages public StartPage() { this.InitializeComponent(); - - // if ((Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"] == Visibility.Visible) - // this.SetIconThemeToDark(); } /// @@ -64,93 +61,5 @@ namespace CampusAppWP8.Pages ContentPanel.Margin = new Thickness(12, 0, 0, 0); } } - - /// - /// start the LectureApp - /// - /// Caller of the function - /// some EventArgs - private void OpenLectureApp(object sender, RoutedEventArgs e) - { - Uri url = new Uri(Constants.PathLecture_LecturePage, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// - /// start the NewsApp - /// - /// Caller of the function - /// some EventArgs - private void OpenNewsApp(object sender, RoutedEventArgs e) - { - Uri url = new Uri(Constants.PathNews_NewsIndexPage, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// - /// start the EventsApp - /// - /// Caller of the function - /// some EventArgs - private void OpenEventsApp(object sender, RoutedEventArgs e) - { - Uri url = new Uri(Constants.PathEvents_EventsIndexPage, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// - /// start the MensaApp - /// - /// Caller of the function - /// some EventArgs - private void OpenMensaApp(object sender, RoutedEventArgs e) - { - Uri url = new Uri(Constants.PathMensa_MensaPage, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// - /// start the WebmailApp - /// - /// Caller of the function - /// some EventArgs - private void OpenWebMailApp(object sender, RoutedEventArgs e) - { - Uri url = new Uri(Constants.PathMail_WebMailPage, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// - /// Opens the opening hours page. - /// - /// opening hours button - /// event args - private void OpenOpeninghoursApp(object sender, RoutedEventArgs e) - { - Uri url = new Uri(Constants.PathOpeninghours_OpeninghoursPage, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// - /// Opens the Linkpage. - /// - /// link button - /// event args - private void OpenLinkApp(object sender, RoutedEventArgs e) - { - Uri url = new Uri(Constants.PathLinks_LinkPage, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// - /// Opens the StudentCouncilpage. - /// - /// link button - /// event args - private void OpenStudentCouncilApp(object sender, RoutedEventArgs e) - { - Uri url = new Uri(Constants.PathStudentCouncil_StudentCouncilPage, UriKind.Relative); - NavigationService.Navigate(url); - } } } \ No newline at end of file From 4f1072553198487cf5f74580576be653c6334334 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Mon, 8 Jul 2013 15:31:56 +0200 Subject: [PATCH 3/3] finisch #85 --- .../CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs | 13 ------------- .../Utility/Lui/Button/NavigateButton.cs | 13 +++++++------ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs index a5256d6b..6f490146 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs @@ -81,18 +81,5 @@ namespace CampusAppWP8.Pages.Lecture } } } - - - /// - /// Method navigate to ModuleWebPage - /// - /// Caller of the function - /// some EventArgs - private void ShowModulWebPage(object sender, RoutedEventArgs e) - { - Button btn = (Button)sender; - Uri url = new Uri(Constants.PathLecture_ModulWebPage + "?" + Constants.ParamModelLecture_ModulNumber + "=" + btn.Tag, UriKind.Relative); - NavigationService.Navigate(url); - } } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs index 5f76143f..147921b0 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/NavigateButton.cs @@ -12,24 +12,24 @@ namespace CampusAppWP8.Utility.Lui.Button using System.Windows.Controls; /// - /// This class create an Button which start the WebBrowser, which an certain url + /// This class create an Button which navigate to a certain page /// public class NavigateButton : System.Windows.Controls.Button { #region Members /// - /// Register the EmailProperty + /// Register the UrlProperty /// public static readonly DependencyProperty NavigateProperty = DependencyProperty.Register("Url", typeof(object), typeof(NavigateButton), new PropertyMetadata(false)); /// - /// Register the EmailProperty + /// Register the QuerryValueProperty /// public static readonly DependencyProperty QueryValueProperty = DependencyProperty.Register("QuerryStringValue", typeof(object), typeof(NavigateButton), new PropertyMetadata(false)); /// - /// Register the EmailProperty + /// Register the QuerryNameProperty /// public static readonly DependencyProperty QueryNameProperty = DependencyProperty.Register("QuerryStringName", typeof(object), typeof(NavigateButton), new PropertyMetadata(false)); @@ -59,7 +59,7 @@ namespace CampusAppWP8.Utility.Lui.Button } /// - /// Gets or sets the Url + /// Gets or sets the QuerryStringName /// public object QuerryStringName { @@ -68,7 +68,7 @@ namespace CampusAppWP8.Utility.Lui.Button } /// - /// Gets or sets the Url + /// Gets or sets the QuerryStringValue /// public object QuerryStringValue { @@ -94,6 +94,7 @@ namespace CampusAppWP8.Utility.Lui.Button { urlString += "?" + this.QuerryStringName + "=" + this.QuerryStringValue; } + Uri url = new Uri(urlString as string, UriKind.Relative); Page page = App.RootFrame.Content as Page; page.NavigationService.Navigate(url);