[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]MVVM Framework
    Getting Started
    Services in ViewModelBase descendants
    Services in POCO objects
    Services in custom ViewModels
    View creation mechanisms
   [Collapse]Predefined Set
    [Expand]Dialog Services
    [Expand]Message Box Services
    [Expand]Document Services
    [Expand]Report Services
    How to create a Custom Service
   Data Annotation Attributes
   Weak Event
 [Expand]Controls and Libraries
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)


The SaveFileDialogService is an ISaveFileDialogService implementation that allows you to save data of a ViewModel to a file by using the standard dialog box.

To use the SaveFileDialogService, attach it to a View as described in Attaching MVVM Behaviors and Services.

Next, access the attached service and use the service's ISaveFileDialogService.ShowDialog method to display a dialog box.

A description on how to obtain a service from a View Model is available here: Services in POCO objects and Services in ViewModelBase descendants.

Then, use the FileInfoWrapper object that is stored in the ISaveFileDialogService.File property to save your data. By default, the SaveFileDialogService uses values of DefaultFileName and SaveFileDialogService.DefaultExt properties to name the file that will be used as the ViewModel's data storage. However, an end-user can specify the file name manually by using the corresponding dialog box fields.


The SaveFileDialogService uses its own FileInfoWrapper class implementing the IFileInfo interface to represent the selected file(s). This class provides the capabilities of the standard FileInfo to work with FileStream objects.

Expanded Example

Is this topic helpful?​​​​​​​