Пример #1
0
        public MainPage()
        {
            InitializeComponent();
            mainDatabase = new WorkoutDatabase();
            lastGPSlocation = null;
            joggingPolyLine = new MapPolyline();
            joggingPolyLine.Stroke = new SolidColorBrush(Colors.Blue);
            joggingPolyLine.StrokeThickness = 5;
            joggingPolyLine.Opacity = 0.7;
            joggingPolyLine.Locations = new LocationCollection();
            map1.Children.Add(joggingPolyLine);
            string deviceName = Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceName").ToString();

            if (deviceName == "XDeviceEmulator")                                                                    // Checks for device name in order to determine whether to simulate a jogger or not
            {
                //Note: The following coordinates is just a Test coordinate for when running the GeoCoordinate simulator
               geowatcher = new GeoCoordinateSimulator(51.5941116666667, 4.77941666666667);

            }
            else
            {
                geowatcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
            }
            geowatcher.PositionChanged += watcher_PositionChanged;
            //The next line is responsible for loading the database from Isolated Storage. The loading and saving implementation works HOWEVER, It is NOT loaded properly and the previous workoutlist does not display previously saved workouts.
               // mainDatabase = dataSave.loadDatabaseFromIsolatedStorage("WorkoutDatabase");

               // checkIfFileExists();
        }
Пример #2
0
 private void displayPreviousWorkoutButton_Click(object sender, RoutedEventArgs e)
 {
     mainDatabase = DataSaver<WorkoutDatabase>.loadDatabaseFromIsolatedStorage("WorkoutDatabase");
     //if (mainDatabase != null)
     //{
     //    mainDatabase.returnAmountOfWorkoutsInDatabase();
     //}
     NavigationService.Navigate(new Uri("/PreviousWorkoutListPage.xaml", UriKind.RelativeOrAbsolute));
 }