# Getting Started with WPF FileDialogs

This article will provide you with the knowledge required to use the file dialogs in a basic scenario.

## Adding Telerik Assemblies Using NuGet

To use RadFileDialogs when working with NuGet packages, install the `Telerik.Windows.Controls.FileDialogs.for.Wpf.Xaml` package. The [package name may vary](https://www.telerik.com/products/wpf/documentation/installation/manual-setup-guides/nuget/available-packages) slightly based on the Telerik dlls set - [Xaml or NoXaml](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/xaml-vs-noxaml)

Read more about NuGet installation in the [Installing UI for WPF from NuGet Package](https://www.telerik.com/products/wpf/documentation/installation/manual-setup-guides/nuget/nuget-installation) article.

> tip With the 2025 Q1 release, the Telerik UI for WPF has a new licensing mechanism. You can learn more about it [here](https://www.telerik.com/products/wpf/documentation/installation/licensing/installing-license-key).

## Adding Assembly References Manually

If you are not using NuGet packages, you can add a reference to the following assemblies:

* **Telerik.Licensing.Runtime**
* **Telerik.Windows.Controls**
* **Telerik.Windows.Controls.Input**
* **Telerik.Windows.Controls.Navigation**
* **Telerik.Windows.Controls.GridView**
* **Telerik.Windows.Controls.FileDialogs**
* **Telerik.Windows.Data**

> For **NET 8** and later you will need to install also the `System.Data.OleDb` NuGet package. This is **required only if the Telerik assemblies are referenced manually** in the project. In case you install the dlls using NuGet or the Telerik Visual Studio Extension, this package is included automatically.

You can find the required assemblies for each control from the Telerik UI for WPF suite in the [Controls Dependencies](https://www.telerik.com/products/wpf/documentation/common-information/installation-installing-dependencies-wpf) help article.

## Using the dialogs

There are few dialogs that you can use in a similar way. **Example 1** shows how to show a **RadOpenFileDialog**. You can use this code to also show the **open folder** and **save file** dialogs.

**Example 1: Opening a dialog**

```C#
RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
openFileDialog.Owner = theHostWindowInstance;
openFileDialog.ShowDialog();
if (openFileDialog.DialogResult == true)
{
    string selectedFileName = openFileDialog.FileName;
}
```

You can see how to define and show the different dialogs in the corresponding articles.

* [RadOpenFileDialog](https://www.telerik.com/products/wpf/documentation/controls/radfiledialogs/dialog-controls/radopenfiledialog)

* [RadOpenFolderDialog](https://www.telerik.com/products/wpf/documentation/controls/radfiledialogs/dialog-controls/radopenfolderdialog)

* [RadSaveFileDialog](https://www.telerik.com/products/wpf/documentation/controls/radfiledialogs/dialog-controls/radsavefiledialog)

## Setting a Theme

The controls from our suite support different themes. You can see how to apply a theme different than the default one in the [Setting a Theme (Using Implicit Styles)](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/styling-apperance-setting-a-theme-overview) help article.

> important Changing the theme using implicit styles will affect all controls that have styles defined in the merged resource dictionaries. This is applicable only for the controls in the scope in which the resources are merged.

To change the theme, you can follow the steps below:

* Choose between the [themes](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/themes-suite/available-themes) and add reference to the corresponding theme assembly (for example: Telerik.Windows.Themes.VisualStudio2013.dll). You see the different themes applied in the Theming examples from our [demos application](https://demos.telerik.com/wpf/).

* Merge the ResourceDictionaries with the namespace required for the controls that you are using from the theme assembly. For **RadTreeView**, you will need to merge the following resources:

  * **System.Windows.xaml**
  * **Telerik.Windows.Controls.xaml**
  * **Telerik.Windows.Controls.Input.xaml**
  * **Telerik.Windows.Controls.Navigation.xaml**
  * **Telerik.Windows.Controls.GridView\.xaml**
  * **Telerik.Windows.Controls.FileDialogs.xaml**

  **Example 2** demonstrates where you can merge the ResourceDictionaries so they are applied globally in the application.

  **Example 2: Merging the ResourceDictionaries**

  ```XAML
  <Application x:Class="MyTestApplication.App"
  		 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  		 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  		 StartupUri="MainWindow.xaml">
      <Application.Resources>
          <ResourceDictionary>
              <ResourceDictionary.MergedDictionaries>
                  <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.xaml" />
                  <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Input.xaml" />
                  <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
                  <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.GridView.xaml" />
                  <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.FileDialogs.xaml" />
              </ResourceDictionary.MergedDictionaries>
          </ResourceDictionary>
      </Application.Resources>
  </Application>
  ```

> caption File dialog with VisualStudio2013 theme applied

![File dialog with VisualStudio2013 theme applied](https://www.telerik.com/products/wpf/documentation/assets/21a8581c0e578eb9f375891d1e48450b/radfiledialogs-getting-started-01.png)

## Telerik UI for WPF Learning Resources

* [Telerik UI for WPF FileDialogs Component](https://www.telerik.com/products/wpf/file-dialogs.aspx)
* [Getting Started with Telerik UI for WPF Components](https://www.telerik.com/products/wpf/documentation/getting-started/first-steps-nuget)
* [Telerik UI for WPF Installation](https://www.telerik.com/products/wpf/documentation/installation/manual-setup-guides/installation-guide)
* [Telerik UI for WPF and WinForms Integration](https://www.telerik.com/products/wpf/documentation/common-information/winforms-integration/overview)
* [Telerik UI for WPF Visual Studio Templates](https://www.telerik.com/products/wpf/documentation/installation/manual-setup-guides/visual-studio-templates)
* [Setting a Theme with Telerik UI for WPF](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/styling-apperance-setting-a-theme-overview)
* [Telerik UI for WPF Virtual Classroom (Training Courses for Registered Users)](https://learn.telerik.com/learn/course/external/view/elearning/16/telerik-ui-for-wpf)
* [Telerik UI for WPF License Agreement](https://www.telerik.com/purchase/license-agreement/wpf-dlw-s)

## See Also

* [Visual Structure](https://www.telerik.com/products/wpf/documentation/controls/radfiledialogs/visual-structure)
* [Events](https://www.telerik.com/products/wpf/documentation/controls/radfiledialogs/events)
