[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].NET Core 3 Support
 [Expand]Common Concepts
 [Collapse]MVVM Framework
  [Expand]View Models
    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 OpenFileDialogService is an IOpenFileDialogService implementation that allows you to browse and open files in the File System by using the standard dialog box.

To implement the file browsing functionality in accordance with the MVVM pattern, use the OpenFileDialogService class provided by MVVM Framework.

Using the OpenFileDialogService functionality requires a OpenFileDialogService instance to be attached to a View. You can do this by using the Smart Tag as described in Attaching MVVM Behaviors and Services or manually as shown in the code snippet below.

To show the dialog box, access the attached OpenFileDialogService (a description on how to obtain a service from a View Model is available here: Services in POCO objects and Services in ViewModelBase descendants) and invoke its IOpenFileDialogService.ShowDialog method.

When the shown dialog is closed and the ShowDialog method returns True, you can obtain the selected file in the IOpenFileDialogService.File property. If the OpenFileDialogService.Multiselect feature is enabled and multiple files are selected, use the IOpenFileDialogService.Files property instead.


The OpenFileDialogService 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 objects of the FileStream type.

If you want to enable the user with the ability to select a folder instead of a file, use the FolderBrowserDialogService instead.

Expanded Example

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