PathPicker

April 9, 2026 · View on GitHub

Combines a read-only TextBox with a browse button. Supports OpenFile, SaveFile, and OpenFolder modes, optional multi-select, file-type filters, and two-way binding on the selected path text.

Basic usage

<!-- Open a single file -->
<PathPicker Mode="OpenFile"
            SelectedPathsText="{Binding FilePath}" />

<!-- Open a folder -->
<PathPicker Mode="OpenFolder"
            SelectedPathsText="{Binding FolderPath}" />

<!-- Save a file -->
<PathPicker Mode="SaveFile"
            SuggestedFileName="output.csv"
            DefaultFileExtension=".csv"
            FileFilter="[CSV,*.csv][All]" />

Properties

PropertyTypeDefaultDescription
ModePathPickerModeOpenFileOpenFile, SaveFile, or OpenFolder
Titlestring?Dialog title shown in the platform picker
AllowMultipleboolfalseAllow selecting multiple paths (OpenFile / OpenFolder only)
SuggestedStartPathstring?Folder the picker opens in by default
SuggestedFileNamestring?Pre-filled file name for SaveFile mode
FileFilterstring?File-type filter string (see format below)
DefaultFileExtensionstring?Default extension for SaveFile mode (e.g. .txt)
SelectedPathsTextstring?Selected path(s) as a newline-separated string — two-way bindable
SelectedPathsIReadOnlyList<string>Selected paths as a list (read-only)
CommandICommand?Command executed after the picker closes — receives SelectedPaths
IsOmitCommandOnCancelboolfalseWhen true, Command is not executed if the user cancels
IsClearSelectionOnCancelboolfalseWhen true, the selection is cleared if the user cancels
UseCustomPickerboolfalseUse the built-in PleasantFileChooser UI instead of the platform-native dialog
ButtonContentobject?Custom content for the browse button (defaults to a folder icon)

PathPickerMode values

ValueDescription
OpenFileOpen one or more existing files
SaveFileChoose a path to save a file
OpenFolderOpen one or more folders

FileFilter format

Filters are specified as [Name,*.ext,*.ext2] groups, or using built-in names:

<!-- Custom filters -->
<PathPicker FileFilter="[Images,*.png,*.jpg,*.webp][All]" />

<!-- Built-in names -->
<PathPicker FileFilter="[ImageAll][Pdf][TextPlain][All]" />

Built-in names: All, Pdf, ImageAll, ImageJpg, ImagePng, ImageWebp, TextPlain

Multi-select

<PathPicker Mode="OpenFile"
            AllowMultiple="True"
            SelectedPathsText="{Binding Paths}" />

When multiple paths are selected, SelectedPathsText contains them newline-separated. SelectedPaths gives you the list directly.

With command

<PathPicker Mode="OpenFile"
            Command="{Binding LoadFileCommand}"
            IsOmitCommandOnCancel="True" />

Custom picker UI

Set UseCustomPicker="True" to use the built-in PleasantFileChooser dialog instead of the OS-native picker:

<PathPicker Mode="OpenFile" UseCustomPicker="True" />