FileSavePickerActivatedEventArgs FileSavePickerActivatedEventArgs FileSavePickerActivatedEventArgs FileSavePickerActivatedEventArgs Class

Provides information about an activated event that fires when the user saves a file through the file picker and selects the app as the location.

JavaScript This type appears as WebUIFileSavePickerActivatedEventArgs.

Syntax

Declaration

public sealed class FileSavePickerActivatedEventArgspublic sealed class FileSavePickerActivatedEventArgsPublic NotInheritable Class FileSavePickerActivatedEventArgspublic sealed class FileSavePickerActivatedEventArgs

Remarks

Learn more about providing your app as a location where the user can save files in the Windows.Storage.Pickers.Provider namespace reference.

A FileSavePickerActivatedEventArgs object is passed to the app's activation point handler when the user saves a file through the file picker and selects the app as the location. This type of activation is indicated by the ActivationKind value returned by the Kind property.

Apps written in JavaScript must listen for and handle Activated events.

Windows Store app 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(LaunchActivatedEventArgs), but defining overrides for other activation points such as OnFileSavePickerActivated(FileSavePickerActivatedEventArgs) is up to your app code.

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

Examples

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


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

// 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;
    this.OnNavigatedTo(null);
    Window.Current.Activate();
}

For C#, args for an OnFileSavePickerActivated(FileSavePickerActivatedEventArgs) override on the Application object references a FileSavePickerActivatedEventArgs object. The OnFileSavePickerActivated(FileSavePickerActivatedEventArgs) override is in the App.xaml.cs file and the Activate method is in the FileSavePickerPage.xaml.cs file of the File picker contracts sample.

Properties summary

The package family name of the app that launched this app.

Gets the ID of the enterprise that owns the file.

Gets the letterbox UI of the file picker that is displayed when the user saves a file and selects the app as the save location.

Gets the activation type.

Gets the execution state of the app before it was activated.

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

Gets the user that the app was activated for.

Properties

  • CallerPackageFamilyName
    CallerPackageFamilyName
    CallerPackageFamilyName
    CallerPackageFamilyName

    The package family name of the app that launched this app.

    public string CallerPackageFamilyName { get; }public string CallerPackageFamilyName { get; }Public ReadOnly Property CallerPackageFamilyName As stringpublic string CallerPackageFamilyName { get; }

    Property Value

    • string
      string
      string
      string

      The caller's package family name.

    Remarks

    CallerPackageFamilyName will be empty if the caller is a non-packaged app (such as a Win32 app).

  • EnterpriseId
    EnterpriseId
    EnterpriseId
    EnterpriseId

    Gets the ID of the enterprise that owns the file.

    public string EnterpriseId { get; }public string EnterpriseId { get; }Public ReadOnly Property EnterpriseId As stringpublic string EnterpriseId { get; }

    Property Value

    • string
      string
      string
      string

      The ID of the enterprise to owns the file.

  • FileSavePickerUI
    FileSavePickerUI
    FileSavePickerUI
    FileSavePickerUI

    Gets the letterbox UI of the file picker that is displayed when the user saves a file and selects the app as the save location.

    public FileSavePickerUI FileSavePickerUI { get; }public FileSavePickerUI FileSavePickerUI { get; }Public ReadOnly Property FileSavePickerUI As FileSavePickerUIpublic FileSavePickerUI FileSavePickerUI { get; }

    Property Value

  • Kind
    Kind
    Kind
    Kind

    Gets the activation type.

    public ActivationKind Kind { get; }public ActivationKind Kind { get; }Public ReadOnly Property Kind As ActivationKindpublic ActivationKind Kind { get; }

    Property Value

  • PreviousExecutionState
    PreviousExecutionState
    PreviousExecutionState
    PreviousExecutionState

    Gets the execution state of the app before it was activated.

    public ApplicationExecutionState PreviousExecutionState { get; }public ApplicationExecutionState PreviousExecutionState { get; }Public ReadOnly Property PreviousExecutionState As ApplicationExecutionStatepublic ApplicationExecutionState PreviousExecutionState { get; }

    Property Value

  • SplashScreen
    SplashScreen
    SplashScreen
    SplashScreen

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

    public SplashScreen SplashScreen { get; }public SplashScreen SplashScreen { get; }Public ReadOnly Property SplashScreen As SplashScreenpublic SplashScreen SplashScreen { get; }

    Property Value

  • User
    User
    User
    User

    Gets the user that the app was activated for.

    public User User { get; }public User User { get; }Public ReadOnly Property User As Userpublic User User { get; }

    Property Value

    Remarks

    This property returns the logged-in user on platforms that only support single-user sessions. For platforms that support multiple users in a session (such as Xbox) this property returns the logged-in user that the app was activated for.

    This property returns null when a multi-user application is activated with no specific user context.

    Multi-user apps can use this property to allow or restrict app behavior. For example, you might restrict access to content or features based on the user’s credentials.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.ApplicationModel.Activation.dll