Skip to main content
FileOpenPickerActivatedEventArgs class

Applies to Windows and Windows Phone

Provides information about an activated event that fires when the user tries to pick files or folders that are provided by the app.

JavaScript:  This type appears as WebUIFileOpenPickerActivatedEventArgs.

Syntax


public sealed class FileOpenPickerActivatedEventArgs : IFileOpenPickerActivatedEventArgs,
    IActivatedEventArgs

Public NotInheritable Class FileOpenPickerActivatedEventArgs
    Implements IFileOpenPickerActivatedEventArgs, _
    IActivatedEventArgs

public ref class FileOpenPickerActivatedEventArgs sealed : IFileOpenPickerActivatedEventArgs,
    IActivatedEventArgs

Attributes

[ MarshalingBehavior(Agile)]
[ Version(0x06020000)]

Members

The FileOpenPickerActivatedEventArgs class has these types of members:

Properties

The FileOpenPickerActivatedEventArgs class has these properties.

PropertyAccess typeDescription

FileOpenPickerUI

Read-onlyGets the letterbox UI of the file picker that is displayed when the user wants to pick files or folders that are provided by the app.

Kind

Read-onlyGets the activation type.

PreviousExecutionState

Read-onlyGets the execution state of the app before it was activated.

SplashScreen

Read-onlyGets a SplashScreen object that provides information about the transition from the splash screen to the activated app.

 

Remarks

Learn how to provide files for the user to pick from your app in Quickstart: Providing file services through file pickers and in the Windows.Storage.Pickers.Provider namespace reference.

A FileOpenPickerActivatedEventArgs object is passed to the app's activated event handler when the user wants to pick files or folders that are provided by the app. This type of activation is indicated by the ActivationKind.FileOpenPicker value that is returned by the Kind property.

Apps written in JavaScript must listen for and handle Windows.UI.WebUI.webUIApplication.activated events.

Windows Store apps using C++, C#, or Visual Basic typically implement activation points by overriding methods of the Application object. The default template app.xaml code-behind files always include an override for OnLaunched, but defining overrides for other activation points such as OnFileOpenPickerActivated is up to your app code.

All Application overrides involved in an activation scenario should call Window.Activate in their implementations.

Examples

The File picker contracts sample demonstrates how to respond to a FileOpenPicker activation point.


// 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();
}

For C#, args for an OnFileOpenPickerActivated override references a FileOpenPickerActivatedEventArgs object. The OnFileOpenPickerActivated override is in the App.xaml.cs file and the Activate method is in the FileOpenPickerPage.xaml.cs file of the File picker contracts sample.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.ApplicationModel.Activation
Windows::ApplicationModel::Activation [C++]

Metadata

Windows.winmd

See also

Quickstart: Providing file services through file pickers
File picker contracts sample
OnFileOpenPickerActivated
Application
FileOpenPicker
Windows.Storage.Pickers.Provider namespace
Windows.UI.WebUI.WebUIApplication.Activated event
Windows.UI.Core.CoreApplicationView.Activated event