private void StartTrackingClick(object sender, RoutedEventArgs e) { isTracking = true; positionLoggingCounter = 0; Dispatcher.BeginInvoke(() => { StopTrackingButton.IsEnabled = true; StartTrackingButton.IsEnabled = false; if (RunnerIDInput.Text == "") { RunnerIDInput.Text = "-1"; } // Save values IsolatedStorageSettings.ApplicationSettings["RunnerID"] = int.Parse(RunnerIDInput.Text); IsolatedStorageSettings.ApplicationSettings["ServerAddress"] = ServerAddressInput.Text; IsolatedStorageSettings.ApplicationSettings["RunnerName"] = NameInput.Text; IsolatedStorageSettings.ApplicationSettings["Password"] = PasswordInput.Text; IsolatedStorageSettings.ApplicationSettings.Save(); RGSender = new RGSender(this); InitializeGeolocator(); }); }
private void StopTracking() { isTracking = false; Dispatcher.BeginInvoke(() => { StopTrackingButton.IsEnabled = false; StartTrackingButton.IsEnabled = true; }); RGSender.Stop(); RGSender = null; }
private void StartTrackingClick(object sender, RoutedEventArgs e) { isTracking = true; positionLoggingCounter = 0; Dispatcher.BeginInvoke(() => { StopTrackingButton.IsEnabled = true; StartTrackingButton.IsEnabled = false; if (RunnerIDInput.Text == "") RunnerIDInput.Text = "-1"; // Save values IsolatedStorageSettings.ApplicationSettings["RunnerID"] = int.Parse(RunnerIDInput.Text); IsolatedStorageSettings.ApplicationSettings["ServerAddress"] = ServerAddressInput.Text; IsolatedStorageSettings.ApplicationSettings["RunnerName"] = NameInput.Text; IsolatedStorageSettings.ApplicationSettings["Password"] = PasswordInput.Text; IsolatedStorageSettings.ApplicationSettings.Save(); RGSender = new RGSender(this); InitializeGeolocator(); }); }