FileOpenPickerUI Class


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

public ref class FileOpenPickerUI sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class FileOpenPickerUI final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class FileOpenPickerUI
Public NotInheritable Class FileOpenPickerUI
Object Platform::Object IInspectable FileOpenPickerUI

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)


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

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

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

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 provider sample.


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 the Windows.ApplicationModel.Activation.FileOpenPickerActivatedEventArgs.FileOpenPickerUI property to access a 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 Open files and folders with a picker.



Gets a list of file types (extensions) that the user can choose.


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


Gets an identifier for the current context of the file picker.


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


AddFile(String, IStorageFile)

Adds the specified file to the list of files that the user has chosen.


Indicates whether the specified file can be added to the list of files the user has chosen.


Determines whether the specified file is in the list of files that the user has chosen.


Removes the specified file from the list of files the user has chosen.



Fires when the user closes the file picker.



The FileRemoved event is deprecated and should not be used.

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.

Applies to

See also