FileSavePickerUI FileSavePickerUI FileSavePickerUI FileSavePickerUI FileSavePickerUI Class


Used to interact with the file picker when your app provides a save location with the File Save Picker contract.

public : sealed class FileSavePickerUI
struct winrt::Windows::Storage::Pickers::Provider::FileSavePickerUI
public sealed class FileSavePickerUI
Public NotInheritable Class FileSavePickerUI
// This class does not provide a public constructor.

Windows 10 requirements

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


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

// fileSavePicker activated event handler
protected override void OnFileSavePickerActivated(FileSavePickerActivatedEventArgs args)
    var FileSavePickerPage = new SDKTemplate.FileSavePickerPage();

// Overloaded method to respond to fileSavePicker events
internal void Activate(FileSavePickerActivatedEventArgs args)
    // Perform tasks to prepare your app to display its file picker page

    // Get file picker UI
    fileSavePickerUI = args.FileSavePickerUI;

    Window.Current.Content = this;

// fileSavePicker activated event handler
function activated(eventObject) {
    // Identify whether app is launched for fileSavePicker
    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 webUIFileSavePickerActivatedEventArgs object.

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


If your app participates in the File Save Picker contract, you can access this object using a fileSavePickerUI property while you handle a filesavepicker activated event.

Use one of the following properties to retrieve a fileSavePickerUI object:

  • JavaScript


  • C#/C++/VB


To learn about creating a good experience for users when they use your app as a save location, see Open files and folders with a picker.


AllowedFileTypes AllowedFileTypes AllowedFileTypes AllowedFileTypes AllowedFileTypes

Gets a list of file types (extensions) that can be saved to the app that is providing the save location.

FileName FileName FileName FileName FileName

Gets the full file name of the file to save, including the file type extension. The file name and extension are specified by the user.

SettingsIdentifier SettingsIdentifier SettingsIdentifier SettingsIdentifier SettingsIdentifier

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

Title Title Title Title Title

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.


TrySetFileName(String) TrySetFileName(String) TrySetFileName(String) TrySetFileName(String) TrySetFileName(String)

Tries to set the file name and extension in the file picker UI.


FileNameChanged FileNameChanged FileNameChanged FileNameChanged FileNameChanged

Fired when the user changes the file name in the file name text box or changes the extension in the file type drop-down menu.

TargetFileRequested TargetFileRequested TargetFileRequested TargetFileRequested TargetFileRequested

Fires when the user commits a file to be saved in the file picker.

See also