Beispiel #1
0
        private async void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            if (pointListFile == null)
            {
                //вызываем окно для выбора папки
                savePicker = new FileSavePicker();
                savePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
                savePicker.FileTypeChoices.Add("Manipulator Points", new List <string>()
                {
                    ".man"
                });
                savePicker.SuggestedFileName = "New Points";
                savePicker.CommitButtonText  = "Сохранить";

                pointListFile = await savePicker.PickSaveFileAsync();

                filePozition.Text = pointListFile.Path;
            }

            if (pointListFile != null)
            {
                await FileIO.WriteTextAsync(pointListFile, PointList.GetJsonConvertString());
            }
            else
            {
                CommonConsoleWrite("Не удалось сохранить файл", Colors.Red);
            }
        }