Exemple #1
0
        public string Show()
        {
            if (Dispatcher.CurrentDispatcher.Thread.IsBackground)
            {
                return(Dispatcher.CurrentDispatcher.Invoke((Func <string>)Show));
            }

            var dialog = _factory.CreateSaveFileDialog();

            dialog.SetTitle(SaveDialogTitle);
            dialog.SetDefaultExtension(DefaultFileExtension);
            dialog.SetFilter(FileFilter);

            var result = dialog.ShowDialog();

            if (!result.HasValue || !result.Value)
            {
                return(null);
            }

            var filePath = dialog.GetFilePath();

            return(filePath);
        }