You can control which files a user sees in the WPF file-open dialog for a blob column by setting the WindowsFileFilter tagged value on a ViewModel column that uses a BlobField.
Use WindowsFileFilter
In WPF, add the WindowsFileFilter tagged value to a ViewModelColumn whose field is a BlobField. The value influences the files shown by the file-open dialog when the user selects a file for that column.
- Open the ViewModel that contains the BlobField column.
- Select the
ViewModelColumnfor the BlobField. - Set the
WindowsFileFiltertagged value to the file filter you want to use. - Run the WPF application and open the file dialog for the column to verify the displayed file types.
For example, to present an image-file choice for a blob column, use:
Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png, *.gif) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png; *.gif
Default behavior
The default filter depends on the BlobField's blob type.
| BlobField blob type | Default file filter |
|---|---|
Image
|
*.jpg; *.jpeg; *.jpe; *.jfif; *.png; *.gif |
Any blob type other than Image
|
Blank; all files are shown. |
Example
Assume that a ViewModel has a BlobField column for a product photograph. If the blob type is Image, the file-open dialog uses the image-file filter by default. If you set WindowsFileFilter on that column, the tagged value controls the filter shown for that column instead.
For a BlobField that is not an Image, no default filter is supplied. Set WindowsFileFilter when you want the file-open dialog to present a specific filter rather than showing all files.
Scope
WindowsFileFilter is described for WPF and affects the file-open dialog used for a BlobField in a ViewModelColumn.
