FolderPicker 類別

定義

表示可讓使用者選擇資料夾的 UI 元素。

在傳統型應用程式中,在以顯示 UI 的方式使用這個類別的實例之前,您必須將物件與其擁有者的視窗控制碼產生關聯。 如需詳細資訊和程式碼範例,請參閱 顯示相依于 CoreWindow 的 WinRT UI 物件

public ref class FolderPicker sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class FolderPicker final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class FolderPicker final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class FolderPicker final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class FolderPicker
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class FolderPicker
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class FolderPicker
function FolderPicker()
Public NotInheritable Class FolderPicker
繼承
Object Platform::Object IInspectable FolderPicker
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

若要開始使用選擇器存取檔案和資料夾,請參閱 使用選擇器開啟檔案和資料夾

版本歷程記錄

Windows 版本 SDK 版本 新增值
1903 18362 CreateForUser
1903 18362 User

建構函式

FolderPicker()

建立 FolderPicker的新實例。

在傳統型應用程式中,在以顯示 UI 的方式使用這個類別的實例之前,您必須將物件與其擁有者的視窗控制碼產生關聯。 如需詳細資訊和程式碼範例,請參閱 顯示相依于 CoreWindow 的 WinRT UI 物件

屬性

CommitButtonText

取得或設定資料夾選擇器認可按鈕的標籤文字。

ContinuationData

取得 App 在 PickFolderAndContinue 作業之前要填入的一組值,以停用應用程式,以便在啟動應用程式時提供內容。 (Windows Phone 8.x 應用程式)

FileTypeFilter

取得資料夾選擇器所顯示的檔案類型集合。

SettingsIdentifier

取得或設定與目前 FolderPicker 實例相關聯的設定識別碼。

SuggestedStartLocation

取得或設定資料夾選擇器尋找要呈現給使用者的資料夾的初始位置。

User

取得建立 FolderPicker 之使用者的相關資訊。 針對 多使用者應用程式使用這個屬性。

ViewMode

取得或設定資料夾選擇器用來顯示專案的檢視模式。

方法

CreateForUser(User)

建立 FolderPicker ,範圍設定為指定使用者的個人目錄。 針對 多使用者應用程式使用這個方法。

PickFolderAndContinue()

從 Windows 10 淘汰;請改用 PickSingleFolderAsync。 顯示檔案選擇器,讓使用者可以挑選資料夾、停用和應用程式,並在作業完成時重新啟用它。 (Windows Phone 8.x 應用程式)

PickSingleFolderAsync()

顯示 folderPicker 物件,讓使用者可以挑選資料夾。 (UWP app)

注意

您必須先指定 FileTypeFilter 再呼叫此方法,否則會擲回例外狀況。 若要列出所有資料夾,請使用 「*」 作為篩選準則。

適用於

另請參閱