Windows Dev Center

FileOpenPickerUI class

Used to interact with the file picker if your app provides files with the File Open Picker contract.


var fileOpenPickerUI = fileOpenPickerActivatedEventArgs.fileOpenPickerUI;


The FileOpenPickerUI class has these types of members:


The FileOpenPickerUI class has these events.

Closing Fires when the user closes the file picker
FileRemoved Fires when the user removes a file from the list of files that the user has chosen if that file was added by the app that is providing files.



The FileOpenPickerUI class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

AddFile Adds the specified file to the list of files that the user has chosen.
CanAddFile Indicates whether the specified file can be added to the list of files the user has chosen.
ContainsFile Determines whether the specified file is in the list of files that the user has chosen.
RemoveFile Removes the specified file from the list of files the user has chosen.



The FileOpenPickerUI class has these properties.

PropertyAccess typeDescription


Read-onlyGets a list of file types (extensions) that the user can choose.


Read-onlyGets an enumeration value that indicates whether the file picker currently limits selection to single files, or if multiple files can be selected.


Read-onlyGets an identifier for the current context of the file picker.


Read/writeGets or sets a title to display in the file picker UI that identifies the location that the file picker is displaying to the user.



If your app participates in the File Open Picker contract, you can retrieve this object using a FileOpenPickerUI property while you handle a fileOpenPicker activated event.

Use one of the following properties to access a FileOpenPickerUI:

JavaScript:  Windows.UI.WebUI.webUIFileOpenPickerActivatedEventArgs.fileOpenPickerUI

C#/C++/VB:  Windows.ApplicationModel.Activation.FileOpenPickerActivatedEventArgs.FileOpenPickerUI

Learn about creating a good experience for users when they access your files through the file picker by reading the UX guidelines for providing files in Guidelines and checklist for file picker contracts.


The File picker sample demonstrates how to respond to a fileOpenPicker activated event.

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

For JavaScript, eventObject contains a webUIFileOpenPickerActivatedEventArgs object.

For C#, args contains a FileOpenPickerActivatedEventArgs object. Additionally, the OnFileOpenPickerActivated is in the App.xaml.cs file and the Activate method is in the FileOpenPickerPage.xaml.cs file of the File picker sample.

Requirements (Windows 10 device family)

Device family


API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::Storage::Pickers::Provider [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

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]


Windows::Storage::Pickers::Provider [C++]





See also

Guidelines and checklist for file pickers
JavaScript reference
Windows.ApplicationModel.Activation.activationKind enumeration
Windows.UI.WebUI.webUIFileOpenPickerActivatedEventArgs class
C#/C++/VB reference
Windows.ApplicationModel.Activation.ActivationKind enumeration
Windows.ApplicationModel.Activation.FileOpenPickerActivatedEventArgs class



© 2015 Microsoft