Megosztás a következőn keresztül:


FileSavePickerActivatedEventArgs Class

Definition

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.

public ref class FileSavePickerActivatedEventArgs sealed : IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
public ref class FileSavePickerActivatedEventArgs sealed : IActivatedEventArgsWithUser, IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class FileSavePickerActivatedEventArgs final : IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class FileSavePickerActivatedEventArgs final : IActivatedEventArgsWithUser, IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class FileSavePickerActivatedEventArgs : IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class FileSavePickerActivatedEventArgs : IActivatedEventArgsWithUser, IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
Public NotInheritable Class FileSavePickerActivatedEventArgs
Implements IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
Public NotInheritable Class FileSavePickerActivatedEventArgs
Implements IActivatedEventArgsWithUser, IFileSavePickerActivatedEventArgs, IFileSavePickerActivatedEventArgs2
Inheritance
Object Platform::Object IInspectable FileSavePickerActivatedEventArgs
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

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 override on the Application object references a FileSavePickerActivatedEventArgs object. The OnFileSavePickerActivated 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.

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.FileSavePicker value returned by the Kind property.

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

UWP 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, but defining overrides for other activation points such as OnFileSavePickerActivated is up to your app code.

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

Version history

Windows version SDK version Value added
1607 14393 User

Properties

CallerPackageFamilyName

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

EnterpriseId

Gets the ID of the enterprise that owns the file.

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.

Kind

Gets the activation type.

PreviousExecutionState

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

SplashScreen

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

User

Gets the user that the app was activated for.

Applies to

See also