Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.dll

NuGet Package: DevExpress.Wpf.Dialogs

#Declaration

public class DXSaveFileDialog :
    DXFileDialog,
    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.

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;
    }
}

#Inheritance

See Also