Share via


FileOpenPickerActivatedEventArgs クラス

定義

ユーザーがアプリによって提供されるファイルまたはフォルダーを選択しようとしたときに発生するアクティブ化されたイベントに関する情報を提供します。

Javascript この型は 、WebUIFileOpenPickerActivatedEventArgs として表示されます。

public ref class FileOpenPickerActivatedEventArgs sealed : IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
public ref class FileOpenPickerActivatedEventArgs sealed : IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class FileOpenPickerActivatedEventArgs final : IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class FileOpenPickerActivatedEventArgs final : IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class FileOpenPickerActivatedEventArgs : IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class FileOpenPickerActivatedEventArgs : IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
Public NotInheritable Class FileOpenPickerActivatedEventArgs
Implements IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
Public NotInheritable Class FileOpenPickerActivatedEventArgs
Implements IActivatedEventArgsWithUser, IFileOpenPickerActivatedEventArgs, IFileOpenPickerActivatedEventArgs2
継承
Object Platform::Object IInspectable FileOpenPickerActivatedEventArgs
属性
実装

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

ファイル ピッカー コントラクト のサンプルでは、FileOpenPicker アクティブ化ポイントに応答する方法を示します。

// File open picker activated event handler
protected override void OnFileOpenPickerActivated(FileOpenPickerActivatedEventArgs args)
{
    var FileOpenPickerPage = new SDKTemplate.FileOpenPickerPage();
    FileOpenPickerPage.Activate(args);
}

// Overloaded method to respond to fileOpenPicker events
public void Activate(FileOpenPickerActivatedEventArgs args)
{
    // Perform tasks to prepare your app to display its file picker page

    // Get file picker UI
    fileOpenPickerUI = args.FileOpenPickerUI;

    Window.Current.Content = this;
    this.OnNavigatedTo(null);
    Window.Current.Activate();
}

C# の場合、 argsOnFileOpenPickerActivated オーバーライドの場合、FileOpenPickerActivatedEventArgs オブジェクトが参照されます。 OnFileOpenPickerActivated オーバーライドは App.xaml.cs ファイル内にあり、Activateメソッドはファイル ピッカー コントラクト サンプルの FileOpenPickerPage.xaml.cs ファイルにあります。

注釈

アプリから選択するファイルをユーザーに提供する方法については、「クイック スタート: Windows.Storage.Pickers.Provider 名前空間リファレンスを使用してファイル サービスを提供する」を参照してください。

FileOpenPickerActivatedEventArgs オブジェクトは、ユーザーがアプリによって提供されるファイルまたはフォルダーを選択するときに、アプリのアクティブ化されたイベント ハンドラーに渡されます。 この種類のアクティブ化は、Kind プロパティによって返される ActivationKind.FileOpenPicker 値によって示されます。

JavaScript で記述されたアプリは、 Windows.UI.WebUI.webUIApplication.activated イベントをリッスンして処理する必要があります。

C++、C#、または Visual Basic を使用する UWP アプリは、通常、 Application オブジェクトのメソッドをオーバーライドすることでアクティブ化ポイントを実装します。 既定のテンプレート app.xaml 分離コード ファイルには 常に OnLaunched のオーバーライドが含まれますが、 OnFileOpenPickerActivated などの他のアクティブ化ポイントのオーバーライドの定義はアプリ コードに依存します。

アクティブ化シナリオに関連するすべての アプリケーション オーバーライドは、実装で Window.Activate を呼び出す必要があります。

バージョン履歴

Windows のバージョン SDK バージョン 追加された値
1607 14393 ユーザー

プロパティ

CallerPackageFamilyName

アプリを起動したアプリのパッケージ ファミリ名。

FileOpenPickerUI

ユーザーがアプリによって提供されるファイルまたはフォルダーを選択するときに表示されるファイル ピッカーのレターボックス UI を取得します。

Kind

アクティブ化の種類を取得します。

PreviousExecutionState

アクティブ化される前のアプリの実行状態を取得します。

SplashScreen

スプラッシュ スクリーンからアクティブ化されたアプリへの切り替えに関する情報を提供する SplashScreen オブジェクトを取得します。

User

アプリがアクティブ化されたユーザーを取得します。

適用対象

こちらもご覧ください