Commits

Ron Huang committed 6c355dc

Removed refresh button.

Comments (0)

Files changed (7)

Add a comment to this file

WhereIsMakkah/Icon/appbar.refresh.rest.png

Removed
Old image

WhereIsMakkah/Lang/AppResources.Designer.cs

         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Refresh.
-        /// </summary>
-        public static string ApplicationBarRefreshLabel {
-            get {
-                return ResourceManager.GetString("ApplicationBarRefreshLabel", resourceCulture);
-            }
-        }
-        
-        /// <summary>
         ///   Looks up a localized string similar to Settings.
         /// </summary>
         public static string ApplicationBarSettingsLabel {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Manually point the small arrow to north..
-        /// </summary>
-        public static string InstructionLabel {
-            get {
-                return ResourceManager.GetString("InstructionLabel", resourceCulture);
-            }
-        }
-        
-        /// <summary>
         ///   Looks up a localized string similar to License.
         /// </summary>
         public static string LicenseLabel {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Note: since Windows Phone 7 does not support Compass API yet (will be available in 7.1,) you have to manually point the top of the phone toward north first to show the direction to Makkah..
+        ///   Looks up a localized string similar to Note: with Windows Phone 7.5, you no longer have to manually point the top of the phone toward north first to show the direction to Makkah..
         /// </summary>
         public static string NoteLabel {
             get {

WhereIsMakkah/Lang/AppResources.resx

   <data name="AppCopyrightText" xml:space="preserve">
     <value>Copyright © 2011 Ron Huang. All rights reserved.  Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.</value>
   </data>
-  <data name="ApplicationBarRefreshLabel" xml:space="preserve">
-    <value>Refresh</value>
-  </data>
   <data name="ApplicationBarSettingsLabel" xml:space="preserve">
     <value>Settings</value>
   </data>
   <data name="ImperialUnitLabel" xml:space="preserve">
     <value>mile(s)</value>
   </data>
-  <data name="InstructionLabel" xml:space="preserve">
-    <value>Manually point the small arrow to north.</value>
-  </data>
   <data name="LicenseLabel" xml:space="preserve">
     <value>License</value>
     <comment>License label on the pivot item in settings page.</comment>
     <value>kilometer(s)</value>
   </data>
   <data name="NoteLabel" xml:space="preserve">
-    <value>Note: since Windows Phone 7 does not support Compass API yet (will be available in 7.1,) you have to manually point the top of the phone toward north first to show the direction to Makkah.</value>
+    <value>Note: with Windows Phone 7.5, you no longer have to manually point the top of the phone toward north first to show the direction to Makkah.</value>
   </data>
   <data name="SettingsTitle" xml:space="preserve">
     <value>Settings</value>

WhereIsMakkah/MainPage.xaml

 	</i:Interaction.Triggers>
 	<phone:PhoneApplicationPage.ApplicationBar>
 		<shell:ApplicationBar IsMenuEnabled="False">
-			<shell:ApplicationBarIconButton Click="RefreshClicked" IconUri="/Icon/appbar.refresh.rest.png" IsEnabled="True" Text="Refresh"/>
 			<shell:ApplicationBarIconButton Click="SettingsClicked" IconUri="/Icon/appbar.feature.settings.rest.png" IsEnabled="True" Text="Settings"/>
 		</shell:ApplicationBar>
 	</phone:PhoneApplicationPage.ApplicationBar>

WhereIsMakkah/MainPage.xaml.cs

                     // Localize the text on application bar.
                     if (ApplicationBar != null)
                     {
-                        var refresh = ApplicationBar.Buttons[0] as ApplicationBarIconButton;
-                        refresh.Text = AppResources.ApplicationBarRefreshLabel;
-                        var settings = ApplicationBar.Buttons[1] as ApplicationBarIconButton;
+                        var settings = ApplicationBar.Buttons[0] as ApplicationBarIconButton;
                         settings.Text = AppResources.ApplicationBarSettingsLabel;
                     }
                 };
             Messenger.Default.Register<GoToPageMessage>(this, (msg) => ReceiveMessage(msg));
         }
 
-        private void RefreshClicked(object sender, EventArgs e)
-        {
-            var vm = DataContext as MainViewModel;
-            if (vm != null)
-            {
-                vm.SensorStartCommand.Execute(null);
-            }
-        }
-
         private void SettingsClicked(object sender, EventArgs e)
         {
             var vm = DataContext as MainViewModel;

WhereIsMakkah/Properties/AssemblyInfo.cs

 //
 // You can specify all the values or you can default the Revision and Build Numbers 
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("0.1.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.2.0")]
+[assembly: AssemblyFileVersion("1.1.0")]
 [assembly: NeutralResourcesLanguageAttribute("en-US")]

WhereIsMakkah/ViewModel/MainViewModel.cs

     /// </summary>
     public class MainViewModel : ViewModelBase
     {
-        /// <summary>
-        /// The <see cref="OffsetFromNorthMatrix" /> property's name.
-        /// </summary>
-        public const string OffsetFromNorthMatrixPropertyName = "OffsetFromNorthMatrix";
-
         private Matrix3D _offsetFromNorthMatrix = Matrix3D.Identity;
 
         /// <summary>
-        /// Gets the OffsetFromNorthMatrix property.
-        /// Changes to that property's value raise the PropertyChanged event. 
-        /// This property's value is broadcasted by the Messenger's default instance when it changes.
-        /// </summary>
-        public Matrix3D OffsetFromNorthMatrix
-        {
-            get
-            {
-                return _offsetFromNorthMatrix;
-            }
-
-            set
-            {
-                if (_offsetFromNorthMatrix == value)
-                {
-                    return;
-                }
-
-                var oldValue = _offsetFromNorthMatrix;
-                _offsetFromNorthMatrix = value;
-
-                // Update bindings, no broadcast
-                RaisePropertyChanged(OffsetFromNorthMatrixPropertyName);
-            }
-        }
-
-        /// <summary>
         /// The <see cref="LocationDetermined" /> property's name.
         /// </summary>
-        public const string LocationDeterminedPropertyName = "LocationDetermined";
-
         private bool _locationDetermined = false;
 
         /// <summary>
         /// </summary>
         public bool LocationDetermined
         {
-            get
-            {
-                return _locationDetermined;
-            }
-
             set
             {
                 if (_locationDetermined == value)
                 _locationDetermined = value;
 
                 // Update bindings, no broadcast
-                RaisePropertyChanged(LocationDeterminedPropertyName);
                 RaisePropertyChanged(DirectionDeterminedPropertyName);
+                RaisePropertyChanged(DistanceLabelPropertyName);
             }
         }
 
         /// <summary>
         /// The <see cref="MotionDetermined" /> property's name.
         /// </summary>
-        public const string MotionDeterminedPropertyName = "MotionDetermined";
-
         private bool _motionDetermined = false;
 
         /// <summary>
         /// </summary>
         public bool MotionDetermined
         {
-            get
-            {
-                return _motionDetermined;
-            }
-
             set
             {
                 if (_motionDetermined == value)
                 _motionDetermined = value;
 
                 // Update bindings, no broadcast
-                RaisePropertyChanged(MotionDeterminedPropertyName);
                 RaisePropertyChanged(DirectionDeterminedPropertyName);
             }
         }
         {
             get
             {
-                if (LocationServiceSetting && Distance >= 0.0)
+                if (LocationServiceSetting && _locationDetermined)
                 {
                     var unit = MetricSetting ? AppResources.MetricUnitLabel : AppResources.ImperialUnitLabel;
 
                 case GeoPositionStatus.Ready:
                     GeoCoordinate loc = _watcher.Position.Location;
 
-                    Feedback = AppResources.FeedbackReadyLabel;
+                    Feedback = "";
                     Distance = GeoDistanceCalculator.DistanceInKilometers(loc.Latitude, loc.Longitude, Makkah.Latitude, Makkah.Longitude);
 
                     var destZ = 360.0 - GeoDistanceCalculator.InitialBearing(loc.Latitude, loc.Longitude, Makkah.Latitude, Makkah.Longitude); // counter-clockwise
-                    OffsetFromNorthMatrix = RotateZTransform(destZ);
+                    _offsetFromNorthMatrix = RotateZTransform(destZ);
                     LocationDetermined = true;
 
                     StopLocationSensor();
             {
                 _motion.Start();
             }
-            catch (Exception ex)
+            catch (Exception)
             {
                 Feedback = AppResources.FeedbackMotionUnableToStartLabel;
             }
             Matrix3D viewport = ViewportTransform(layoutWidth, layoutHeight);
 
             Matrix3D m = centerImageAtOrigin * invertYAxis;
-            m = m * OffsetFromNorthMatrix;
+            m = m * _offsetFromNorthMatrix;
             m = m * XnaMatrixToMatrix3D(e.Attitude.RotationMatrix);
             m = m * translateAwayFromCamera;
             m = m * perspective;
 
         private void ReceiveMessage(SettingsChangedMessage msg)
         {
-            // FIXME: for the time being, only raise unit propery
             var key = msg.Key;
             if (key.Equals("Unit"))
             {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.