private async Task <Unit> SaveGraph() { string path = string.Empty; Stream myStream; var saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "csv files (*.csv)|*.csv"; saveFileDialog.FilterIndex = 2; saveFileDialog.RestoreDirectory = true; if (saveFileDialog.ShowDialog() == true) { path = saveFileDialog.FileName; } var csvLists = BuildList(); foreach (var csvList in csvLists) { if (!string.IsNullOrEmpty(csvList.First().Name)) { await csvWriter.CreateAndSaveCsv(csvList, path.Insert(path.Length - 4, csvList.First().Name)); } } return(Unit.Default); }