public static async void ExportMeasurementData(MeasurementModel measurement) { var savePicker = new Windows.Storage.Pickers.FileSavePicker(); StorageFolder resultFolder = await ApplicationData.Current.LocalFolder.GetFolderAsync("Evaluation"); StorageFolder resultFolder2 = await resultFolder.GetFolderAsync("Accelerometer"); StorageFile resultFile = await resultFolder2.GetFileAsync(measurement.Filename); //await resultFile.CopyAsync(Windows.Storage.KnownFolders.DocumentsLibrary, "e" + measurement.AccelerometerFilename); savePicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary; // Dropdown of file types the user can save the file as savePicker.FileTypeChoices.Add("Binary-Datei", new List<string>() { ".bin" }); // Default file name if the user does not type one in or select a file to replace savePicker.SuggestedFileName = "e" + measurement.Filename; savePicker.PickSaveFileAndContinue(); }
private void ExportMeasurement(MeasurementViewModel measurementViewModel) { // Show loader _mainPage.ShowLoader(); //_mainPage.ExportMeasurementData(measurementViewMdel.Id); if (measurementViewModel.Id != null && measurementViewModel.Id.Length > 0) { MeasurementModel measurement = _mainPage.GlobalMeasurementModel.GetMeasurementById(measurementViewModel.Id); if (measurement != null) { var savePicker = new Windows.Storage.Pickers.FileSavePicker(); savePicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary; // Dropdown of file types the user can save the file as savePicker.FileTypeChoices.Add("Binary-File", new List<string>() { ".bin" }); // Default file name if the user does not type one in or select a file to replace savePicker.SuggestedFileName = String.Format("{0}_{1:yyyy-MM-dd_HH-mm-ss}", measurement.Setting.Name, measurement.StartTime); // Open the file picker and call the method "ContinueFileSavePicker" when the user select a file. savePicker.PickSaveFileAndContinue(); } } // Hide loader _mainPage.HideLoader(); }