Back to Devexpress

DXSaveFileDialog Class

wpf-devexpress-dot-xpf-dot-dialogs-a13249a5.md

latest2.9 KB
Original Source

DXSaveFileDialog Class

Represents a dialog box that allows end-users to specify a filename to which to save a file.

Namespace : DevExpress.Xpf.Dialogs

Assembly : DevExpress.Xpf.Dialogs.v25.2.dll

NuGet Package : DevExpress.Wpf.Dialogs

Declaration

csharp
public class DXSaveFileDialog :
    DXFileDialog,
    ISaveFileDialog,
    IFileDialog,
    ICommonDialog,
    IDisposable
vb
Public Class DXSaveFileDialog
    Inherits DXFileDialog
    Implements ISaveFileDialog,
               IFileDialog,
               ICommonDialog,
               IDisposable

Remarks

The DXSaveFileDialog provides the standard save file dialog functionality and supports DevExpress theming mechanism that allows your applications to look consistent.

When an end-user changes a current directory in the DXSaveFileDialog or DXOpenFileDialog, the application’s current directory changes too. The current directory’s path is stored in the DXSaveFileDialog property. You can get the application’s current directory using the WPF standard GetCurrentDirectory method.

The code sample below demonstrates how to show the file dialog in a button click event handler and retrieve the provided file name.

csharp
private void button_Click(object sender, RoutedEventArgs e) {
    var fileDialog = new DXSaveFileDialog();
    var result = fileDialog.ShowDialog();
    // Retrieve the specified file name using the FileName property, e.g.:
    // Process save file dialog results
    if (result == true)
    {
      // Save document
      string filename = fileDialog.FileName;
    }
}
vb
Private Sub button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Dim fileDialog = New DXSaveFileDialog()
    Dim result = fileDialog.ShowDialog()
    ' Retrieve the specified file name using the FileName property, e.g.:
    ' Process save file dialog results
    If result = True Then
        ' Save document
        Dim filename As String = fileDialog.FileName
    End If
End Sub

Inheritance

Object CommonDialog DXCommonDialog DXFileDialog DXSaveFileDialog

See Also

DXSaveFileDialog Members

DevExpress.Xpf.Dialogs Namespace