diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 69a8462f..49f9a372 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -427,6 +427,7 @@ + @@ -449,8 +450,9 @@ - - ..\packages\WPToolkit.4.2013.06.11\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll + + False + ..\packages\WPtoolkit.4.2013.08.16\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs index bf6ed617..42ce2b8b 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs @@ -9,6 +9,7 @@ namespace CampusAppWP8.Pages.Campusmap { using System; using System.Globalization; + using System.Threading; using System.Windows; using System.Windows.Navigation; using CampusAppWP8.Model.Campusmap; @@ -16,19 +17,15 @@ namespace CampusAppWP8.Pages.Campusmap using CampusAppWP8.Utility; using Microsoft.Phone.Controls; - /// - /// Class for the campusMap page - /// + /// Class for the campusMap page. + /// Stubbfel, 19.08.2013. public partial class CampusMapPage : PhoneApplicationPage { - /// - /// Variable for the map model - /// + /// Variable for the map model. private MapModel map; - /// - /// Initializes a new instance of the class. - /// + /// Initializes a new instance of the class. + /// Stubbfel, 19.08.2013. public CampusMapPage() { this.InitializeComponent(); @@ -36,31 +33,28 @@ namespace CampusAppWP8.Pages.Campusmap this.MapCanvas.DataContext = this.map; } - /// - /// Methods overrides the OnNavigatedTo-Method - /// - /// some NavigationEventArgs + /// Methods overrides the OnNavigatedTo-Method. + /// Stubbfel, 19.08.2013. + /// some NavigationEventArgs. protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); this.ShowCurrentPositionDispatcher(); } - /// - /// Button click method - /// - /// caller object - /// some EventArgs + /// Button click method. + /// Stubbfel, 19.08.2013. + /// caller object. + /// some EventArgs. private void Button_Click(object sender, RoutedEventArgs e) { this.AddPin(double.Parse(XPoint.Text), double.Parse(YPoint.Text)); } - /// - /// Add Pin to an certain position - /// - /// longitude parameter - /// latitude parameter + /// Add Pin to an certain position. + /// Stubbfel, 19.08.2013. + /// longitude parameter. + /// latitude parameter. private void AddPin(double x, double y) { MapCanvas.Children.Clear(); @@ -74,39 +68,44 @@ namespace CampusAppWP8.Pages.Campusmap YPoint.Text = y.ToString(); } - /// - /// On clicking the update button in the ApplicationBar. - /// - /// caller object - /// some EventArgs + /// On clicking the update button in the ApplicationBar. + /// Stubbfel, 19.08.2013. + /// caller object. + /// some EventArgs. private void UpdateButtonAppBar_Click(object sender, System.EventArgs e) { this.ShowCurrentPositionDispatcher(); } - /// - /// execute ShowCurrentPosition-Method via Dispatcher - /// + /// execute ShowCurrentPosition-Method via Dispatcher. + /// Stubbfel, 19.08.2013. private void ShowCurrentPositionDispatcher() { ProgressBar.Visibility = Visibility.Visible; + Thread thread = new Thread(new ThreadStart(this.ShowCurrentPosition)); + thread.Start(); + } + + /// Method add a pin on the at the position of the phone. + /// Stubbfel, 19.08.2013. + private void ShowCurrentPosition() + { + Utilities.DetermineAndStoreCurrentPositionForce(); if (this.Dispatcher != null) { - this.Dispatcher.BeginInvoke(new Action(() => this.ShowCurrentPosition())); + this.Dispatcher.BeginInvoke(new Action(() => this.SetPinToCurrentPosition())); } else { - this.ShowCurrentPosition(); - } + this.SetPinToCurrentPosition(); + } } - /// - /// Method add a pin on the at the position of the phone - /// - private void ShowCurrentPosition() - { - Utilities.DetermineAndStoreCurrentPositionForce(); + /// Sets pin to current position. + /// Stubbfel, 19.08.2013. + private void SetPinToCurrentPosition() + { string lat = App.LoadFromAppState(Constants.GeoWatch_CurrentPosition_Lat); string log = App.LoadFromAppState(Constants.GeoWatch_CurrentPosition_Long); double x; diff --git a/CampusAppWP8/CampusAppWP8/Toolkit.Content/ApplicationBar.Add.png b/CampusAppWP8/CampusAppWP8/Toolkit.Content/ApplicationBar.Add.png new file mode 100644 index 00000000..4b524d6f Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Toolkit.Content/ApplicationBar.Add.png differ diff --git a/CampusAppWP8/CampusAppWP8/packages.config b/CampusAppWP8/CampusAppWP8/packages.config index f3d7e2f0..145c4038 100644 --- a/CampusAppWP8/CampusAppWP8/packages.config +++ b/CampusAppWP8/CampusAppWP8/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file