FileOpenPicker.FileTypeFilter Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the collection of file types that the file open picker displays.
public:
property IVector<Platform::String ^> ^ FileTypeFilter { IVector<Platform::String ^> ^ get(); };
IVector<winrt::hstring> FileTypeFilter();
public IList<string> FileTypeFilter { get; }
var iVector = fileOpenPicker.fileTypeFilter;
Public ReadOnly Property FileTypeFilter As IList(Of String)
Property Value
A fileExtensionVector object that contains a collection of file types (file name extensions) , such as ".doc" and ".png". Using .
before the file extension is required (e.g. ".txt") unless specifying only a wildcard "*". See examples below. 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.
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".jpeg");
openPicker.FileTypeFilter.Add(".png");
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.List;
openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
openPicker.FileTypeFilter.Add("*");
Applies to
See also
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro