private void SaveGpxButton_Click(object sender, RoutedEventArgs e) { e.Handled = true; if (GpxUtils.SaveGpxDialog(out string gpxFileName) == System.Windows.Forms.DialogResult.OK) { GpxUtils.SaveGpxCoordinates(route, gpxFileName); } }
/// <summary> /// load GPX /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void load_gpx_button_Click(object sender, RoutedEventArgs e) { if (GpxUtils.OpenGpxDlg(out string gpxFileName) == System.Windows.Forms.DialogResult.Cancel) { return; } if (gpxFileName == null || gpxFileName.Length == 0) { return; } var newRoute = GpxUtils.ReadGpxCoords(gpxFileName); route.Clear(); foreach (Location loc in newRoute) { route.Add(loc); } navigator.SetRoute(route); uiMgr.SetRoute(route); myMap.Center = route[0]; }