FileOpenPicker.FileTypeFilter プロパティ

定義

ファイルを開くピッカーに表示されるファイルの種類のコレクションを取得します。

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)

プロパティ値

IVector<String>

IList<String>

IVector<Platform::String>

IVector<winrt::hstring>

".doc" や ".png" などのファイルの種類 (ファイル名拡張子) のコレクションを含む fileExtensionVector オブジェクト。 ワイルドカード "*" のみを指定しない限り、ファイル拡張子の前に を使用 . する (例: ".txt")。 以下の例を参照してください。 ファイル名拡張子は、この配列に 文字列 オブジェクトとして格納されます。

ファイル ピッカーのサンプルでは、ユーザーがファイル ピッカーで表示および選択できるファイルの種類を指定する方法を示します。

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("*");

適用対象

こちらもご覧ください