Esempio n. 1
0
        /// <inheritdoc/>
        async Task IEditorApplication.OnExportXamlAsync(object item)
        {
            try
            {
                var dlg = new SaveFileDialog();
                dlg.Filters.Add(new FileDialogFilter()
                {
                    Name = "Xaml", Extensions = { "xaml" }
                });
                dlg.Filters.Add(new FileDialogFilter()
                {
                    Name = "All", Extensions = { "*" }
                });
                dlg.InitialFileName  = _editor?.GetName(item);
                dlg.DefaultExtension = "xaml";
                var result = await dlg.ShowAsync(_mainWindow);

                if (result != null)
                {
                    _editor?.OnExportXaml(result, item);
                }
            }
            catch (Exception ex)
            {
                _log?.LogError($"{ex.Message}{Environment.NewLine}{ex.StackTrace}");
            }
        }
Esempio n. 2
0
        /// <inheritdoc/>
        async Task IEditorApplication.OnExportXamlAsync(object item)
        {
            var dlg = new SaveFileDialog()
            {
                Filter      = "Xaml (*.xaml)|*.xaml|All (*.*)|*.*",
                FilterIndex = 0,
                FileName    = _editor?.GetName(item)
            };

            if (dlg.ShowDialog(_mainWindow) == true)
            {
                _editor?.OnExportXaml(dlg.FileName, item);
            }

            await Task.Delay(0);
        }