共用方式為


WebUIFileOpenPickerActivatedEventArgs 類別

定義

提供使用者嘗試挑選應用程式所提供之檔案或資料夾時所引發之啟動事件的相關資訊。

C#/C++/VB 此類型會顯示為 FileOpenPickerActivatedEventArgs

public ref class WebUIFileOpenPickerActivatedEventArgs sealed : IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
public ref class WebUIFileOpenPickerActivatedEventArgs sealed : IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class WebUIFileOpenPickerActivatedEventArgs final : IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class WebUIFileOpenPickerActivatedEventArgs final : IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class WebUIFileOpenPickerActivatedEventArgs : IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class WebUIFileOpenPickerActivatedEventArgs : IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2, IActivatedEventArgsDeferral
Public NotInheritable Class WebUIFileOpenPickerActivatedEventArgs
Implements IActivatedEventArgsDeferral, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
Public NotInheritable Class WebUIFileOpenPickerActivatedEventArgs
Implements IActivatedEventArgsDeferral, IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
繼承
Object Platform::Object IInspectable WebUIFileOpenPickerActivatedEventArgs
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

檔案選擇器範例示範如何回應檔案OpenPicker啟動事件。

// File open picker activated event handler
function activated(eventObject) {
    // Identify whether app is launched for fileOpenPicker
    if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.fileOpenPicker) {
        // Perform tasks to prepare your app to display its file picker page

        // Get file picker UI
        fileOpenPickerUI = eventObject.detail.fileOpenPickerUI;

        eventObject.setPromise(WinJS.UI.processAll().then(function () {
            // Navigate to either the first scenario or to the last running scenario
            // before suspension or termination.
            var url = scenarios[0].url;
            return WinJS.Navigation.navigate(url, fileOpenPickerUI);
        }));
    }
}

// Register the activated event handler
WinJS.Application.addEventListener("activated", activated, false);

針對 JavaScript, eventObject 包含 webUIFileOpenPickerActivatedEventArgs 物件。

備註

瞭解如何在快速入門:透過Windows.Storage.Pickers.Provider命名空間參考中提供檔案服務,讓使用者從您的應用程式挑選檔案。

當您在ActivationKindfileOpenPicker時,實作WinJS.Application.OnactivatedWindows.UI.WebUI.WebUIApplication.activated事件的事件處理常式時,就會存取此物件。

注意

這個類別不是敏捷的,這表示您必須考慮其執行緒模型和封送處理行為。 如需詳細資訊,請參閱 執行緒和封送處理 (C++/CX)

版本歷程記錄

Windows 版本 SDK 版本 新增值
1607 14393 User

屬性

ActivatedOperation

取得應用程式啟動的作業。

CallerPackageFamilyName

取得呼叫端套件的系列名稱。

FileOpenPickerUI

取得當使用者想要挑選應用程式提供之檔案或資料夾時,所顯示的檔案選擇器的信件箱 UI。

Kind

取得啟用類型。

PreviousExecutionState

取得應用程式啟動前的執行狀態。

SplashScreen

取得啟動顯示畫面物件,該物件提供從啟動顯示畫面轉換到啟動之應用程式的相關資訊。

User

取得應用程式已啟用的使用者。

適用於

另請參閱