FileSavePicker.FileTypeChoices Property


Gets the collection of valid file types that the user can choose to assign to a file.

 property IMap<Platform::String ^, IVector<Platform::String ^> ^> ^ FileTypeChoices { IMap<Platform::String ^, IVector<Platform::String ^> ^> ^ get(); };
IMap<winrt::hstring, IVector<winrt::hstring> const&> FileTypeChoices();
public IDictionary<string,IList<string>> FileTypeChoices { get; }
var iMap = fileSavePicker.fileTypeChoices;
Public ReadOnly Property FileTypeChoices As IDictionary(Of String, IList(Of String))

Property Value



A FilePickerFileTypesOrderedMap object that contains a collection of valid file types (extensions) that the user can use to save a file. Each element in this collection maps a display name to a corresponding collection of file name extensions. The key is a single string, the value is a list/vector of strings representing one or more extension choices.


The File picker sample demonstrates how to add file type choices with a display name.

FileSavePicker savePicker = new FileSavePicker();
savePicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
// Dropdown of file types the user can save the file as
savePicker.FileTypeChoices.Add("Plain Text", new List<string>() { ".txt" });
// Default file name if the user does not type one in or select a file to replace
savePicker.SuggestedFileName = "New Document";
auto plainTextExtensions{ winrt::single_threaded_vector<winrt::hstring>() };

savePicker.FileTypeChoices().Insert(L"Plain Text", plainTextExtensions);
savePicker.SuggestedFileName(L"New Document");


Some apps do not need to understand a file format in order to process it - such as a cloud storage provider. Therefore, using the file wildcard character - "*" - is supported for the FileOpenPicker.FileTypeFilter collection. However, writing a file requires knowledge of its format. As a result, the wildcard is not supported for FileSavePicker.FileTypeChoices.

One display name as a classification of file types might have multiple file types that support it. For example, a display name of "HTML page" could be saved either with ".htm" or ".html" extension. That is why the value of each entry in a FilePickerFileTypesOrderedMap is an ordered list (vector) of strings, displayed in the UI in the order that you place the extensions in the vector.

Applies to

See also