From d81599f3679a63dfe1fd71210c6cc0211d35da42 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Thu, 21 Nov 2013 13:23:04 +0100 Subject: [PATCH] finish new startpage --- CampusAppWP8/CampusAppWP8/App.xaml.cs | 2 +- .../CampusAppWP8/Pages/StartPage.xaml | 398 +++++++++--------- .../CampusAppWP8/Pages/StartPage.xaml.cs | 152 +------ .../CampusAppWP8/Resources/Constants.resx | 3 + .../Resources/Constants1.Designer.cs | 9 + .../Utility/Lui/Tiles/TileCreator.cs | 39 ++ 6 files changed, 266 insertions(+), 337 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/App.xaml.cs b/CampusAppWP8/CampusAppWP8/App.xaml.cs index 65acbc71..3b4121ce 100644 --- a/CampusAppWP8/CampusAppWP8/App.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/App.xaml.cs @@ -212,7 +212,7 @@ namespace CampusAppWP8 // Dieser Code wird beim Deaktivieren der Anwendung nicht ausgeführt private void Application_Closing(object sender, ClosingEventArgs e) { - // Sicherstellen, dass der erforderliche Anwendungszustand hier beibehalten wird + App.SaveToIsolatedStorage("StartPageIndex", null); } // Code, der bei einem Navigationsfehler ausgeführt wird diff --git a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml index d398b500..2e3e784e 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml @@ -19,53 +19,54 @@ - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - + + + + @@ -77,10 +78,10 @@ - - - - + + + + @@ -92,10 +93,10 @@ - - - - + + + + @@ -107,10 +108,10 @@ - - - - + + + + @@ -119,158 +120,160 @@ - + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - + + - - - - - - - + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs index c083222b..2b55eb1e 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs @@ -81,7 +81,7 @@ namespace CampusAppWP8.Pages #region protected - /// Methods overrides the OnNavigatedTo-Method. + /// Methods overrides the OnNavigatedTo-Method. /// Stubbfel, 15.10.2013. /// protected override void OnNavigatedTo(NavigationEventArgs e) @@ -90,7 +90,7 @@ namespace CampusAppWP8.Pages if (device != null) { this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler); - } + } } /// Methods overrides the OnNavigatedFrom-Method. @@ -125,138 +125,13 @@ namespace CampusAppWP8.Pages this.initCourseList.SaveData(); } - /// Raises the orientation changed event. - /// Fiedler, 22.10.2013. - /// - /// ### Event information to send to registered event handlers. - protected override void OnSwitchedToPortrait(OrientationChangedEventArgs e) - { - base.OnSwitchedToPortrait(e); - - this.ApplicationBar.Opacity = 0.5; - - //this.ContentPanel.Margin = new Thickness(12, 0, 12, 12); - //this.AppTitle.Margin = new Thickness(12, 17, 0, 28); - - /* if (!this.Row0.Children.Contains(this.MailAppButton) - && !this.Row1.Children.Contains(this.OpenHoursAppButton) - && !this.Row2.Children.Contains(this.LinkAppButton)) - { - return; - } - - this.Row0.Children.Remove(this.MailAppButton); - this.Row3.Children.Add(this.MailAppButton); - this.MailAppButton.SetValue(Grid.ColumnProperty, 0); - - this.Row1.Children.Remove(this.OpenHoursAppButton); - this.Row3.Children.Add(this.OpenHoursAppButton); - this.OpenHoursAppButton.SetValue(Grid.ColumnProperty, 1); - - this.Row2.Children.Remove(this.LinkAppButton); - this.Row3.Children.Add(this.LinkAppButton); - this.LinkAppButton.SetValue(Grid.ColumnProperty, 2); */ - } - - /// Raises the orientation changed event. - /// Fiedler, 22.10.2013. - /// - /// ### Event information to send to registered event handlers. - protected override void OnSwitchedToLandscape(OrientationChangedEventArgs e) - { - base.OnSwitchedToLandscape(e); - - this.ApplicationBar.Opacity = 1.0; - - //this.ContentPanel.Margin = new Thickness(76, -24, 24, 0); // LandscapeRight - //this.ContentPanel.Margin = new Thickness(24, -24, 76, 0); // LandscapeLeft - //this.AppTitle.Margin = new Thickness(12, 17, 0, 28); -/* - if (!this.Row3.Children.Contains(this.MailAppButton) - && !this.Row3.Children.Contains(this.OpenHoursAppButton) - && !this.Row3.Children.Contains(this.LinkAppButton)) - { - return; - } - - this.Row3.Children.Remove(this.MailAppButton); - this.Row0.Children.Add(this.MailAppButton); - this.MailAppButton.SetValue(Grid.ColumnProperty, 3); - - this.Row3.Children.Remove(this.OpenHoursAppButton); - this.Row1.Children.Add(this.OpenHoursAppButton); - this.OpenHoursAppButton.SetValue(Grid.ColumnProperty, 3); - - this.Row3.Children.Remove(this.LinkAppButton); - this.Row2.Children.Add(this.LinkAppButton); - this.LinkAppButton.SetValue(Grid.ColumnProperty, 3);*/ - } - /// Method Navigate to /// Stubbfel, 15.10.2013. /// Caller of the function. /// some EventArgs. - private void ApplicationBarMenuItem_Click(object sender, EventArgs e) - { - Uri url = new Uri(Constants.PathSetting_User, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// Method Navigate to - /// Stubbfel, 15.10.2013. - /// Caller of the function. - /// some EventArgs. - private void ApplicationBarMenuItem2_Click(object sender, EventArgs e) - { - Uri url = new Uri(Constants.PathSetting_App, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// Method Navigate to - /// Stubbfel, 15.10.2013. - /// Caller of the function. - /// some EventArgs. - private void ApplicationBarMenuItem4_Click(object sender, EventArgs e) + private void NFCButton_Click(object sender,RoutedEventArgs e) { MessageBoxes.ShowMainModelInfoMessageBox(AppResources.ScarNfc_Search); - // this.device.StopSubscribingForMessage(this.ndefId); - // this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler); - } - - /// Event handler. Called by ApplicationBarMenuItem5 for click events. - /// Stubbfel, 14.10.2013. - /// Caller of the function. - /// Event information. - private void ApplicationBarMenuItem5_Click(object sender, EventArgs e) - { - Uri url = new Uri("/Pages/Setting/Impressum.xaml", UriKind.Relative); - NavigationService.Navigate(url); - } - - /// Event handler. Called by ApplicationBarMenuItem4 for click events. - /// Stubbfel, 15.10.2013. - /// Caller of the function. - /// Event information. - private void ApplicationBarMenuItem3_Click(object sender, EventArgs e) - { - Uri url = new Uri("/Pages/Dev/QRScanner.xaml", UriKind.Relative); - NavigationService.Navigate(url); - } - - /// Method change the Opacity of the ApplicationBar. - /// Stubbfel, 15.10.2013. - /// Caller of the function. - /// some EventArgs. - private void ApplicationBar_StateChanged(object sender, ApplicationBarStateChangedEventArgs e) - { - if (e.IsMenuVisible) - { - ApplicationBar.Opacity = 0.99; - } - else - { - ApplicationBar.Opacity = 0.5; - } } /// Method show all OptIns. @@ -350,6 +225,15 @@ namespace CampusAppWP8.Pages case "placeNewsAppButton": TileCreator.CreatePlaceNewsTile(); break; + case "QRButton": + TileCreator.CreateQRTile(); + break; + case "NFCButton": + TileCreator.CreateNFCTile(); + break; + case "TimeTableAppButton": + TileCreator.CreateTimeTableTile(); + break; } } @@ -469,18 +353,6 @@ namespace CampusAppWP8.Pages #endregion - private void ApplicationBarMenuItem_Click_1(object sender, EventArgs e) - { - Uri url = new Uri(Constants.PathTimeTable_Day, UriKind.Relative); - NavigationService.Navigate(url); - } - #endregion - - private void ApplicationBarMenuItem_Click_2(object sender, EventArgs e) - { - Uri url = new Uri("/Pages/Dev/NFC.xaml", UriKind.Relative); - NavigationService.Navigate(url); - } } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index aff32e18..34d6095c 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -618,4 +618,7 @@ EventAppointment + + /Pages/Setting/Impressum.xaml + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs index c0ded70b..58946cba 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs @@ -1050,6 +1050,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/Impressum.xaml ähnelt. + /// + public static string PathSetting_Impressum { + get { + return ResourceManager.GetString("PathSetting_Impressum", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/UserProfil.xaml ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs index ba0fe5aa..d2ccdae3 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs @@ -12,6 +12,7 @@ namespace CampusAppWP8.Utility.Lui.Tiles using System.Linq; using CampusAppWP8.Resources; using Microsoft.Phone.Shell; + using CampusAppWP8.Model.Setting; /// Class creates different live tiles. /// Stubbfel, 15.10.2013. @@ -147,5 +148,43 @@ namespace CampusAppWP8.Utility.Lui.Tiles { TileCreator.CreateIconicTile(AppResources.CampusMapApp_Title, Constants.PathCampusmap_Campusmap, Icons.Campus, Icons.Campus); } + + /// Creates time table tile. + /// Stubbfel, 21.11.2013. + public static void CreateTimeTableTile() + { + TileCreator.CreateIconicTile(AppResources.TimeTableApp_Title, Constants.PathTimeTable_Week, Icons.Schedule, Icons.Schedule); + } + + /// Creates qr tile. + /// Stubbfel, 21.11.2013. + public static void CreateQRTile() + { + TileCreator.CreateIconicTile(AppResources.App_ScanQR, Constants.PathQR_QRPage, Icons.Favorite, Icons.Favorite); + } + + /// Creates nfc tile. + /// Stubbfel, 21.11.2013. + public static void CreateNFCTile() + { + string path; + string name = "NFC -> "; + switch (Settings.AppSetting.TagDefaultHandler) + { + case BTUTagDefaultHandler.CampusMap: + path = Constants.PathCampusmap_Campusmap; + name += AppResources.CampusMapApp_Title; + break; + case BTUTagDefaultHandler.DateCreation: + path = Constants.PathTimeTable_Week; + name += AppResources.TimeTableApp_Title; + break; + default: + path = Constants.PathBTUTag_Info; + name += AppResources.BTUTag_Title; + break; + } + TileCreator.CreateIconicTile(name, path, Icons.Favorite, Icons.Favorite); + } } }