FileOpenPicker.FileTypeFilter | fileTypeFilter property

Applies to Windows and Windows Phone

Gets the collection of file types that the file open picker displays.

Syntax


var fileTypeFilter = fileOpenPicker.fileTypeFilter;

Property value

Type: IVector<String> [JavaScript/C++] | System.Collections.Generic.IList<String> [.NET]

A fileExtensionVector object that contains a collection of file types (file name extensions) , such as ".doc" and ".png". File name extensions are stored in this array as string objects.

Examples

The File picker sample demonstrates how to specify the file types that the user can see and pick from in the file picker.


// Create the picker object and set options
var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
openPicker.viewMode = Windows.Storage.Pickers.PickerViewMode.thumbnail;
openPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
// Users expect to have a filtered view of their folders depending on the scenario.
// For example, when choosing a documents folder, restrict the filetypes to documents for your application.
openPicker.fileTypeFilter.replaceAll([".png", ".jpg", ".jpeg"]);


The File picker sample demonstrates how to show files of any type in the file picker for the user to pick from.


var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
openPicker.viewMode = Windows.Storage.Pickers.PickerViewMode.list;
openPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.documentsLibrary;
openPicker.fileTypeFilter.replaceAll(["*"]);


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Storage.Pickers
Windows::Storage::Pickers [C++]

Metadata

Windows.winmd

See also

File picker sample
Quickstart: Accessing files with file pickers
fileOpenPicker class
fileExtensionVector class

 

 

Show:
© 2014 Microsoft