FileActivatedEventArgs class

Applies to Windows and Windows Phone

Provides data when an app is activated because it is the app associated with a file.

JavaScript:  This type appears as WebUIFileActivatedEventArgs.

Syntax


Public NotInheritable Class FileActivatedEventArgs
    Implements IFileActivatedEventArgs, _
    IActivatedEventArgs, _
    IFileActivatedEventArgsWithNeighboringFiles, _
    IApplicationViewActivatedEventArgs

Attributes

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Members

The FileActivatedEventArgs class has these types of members:

Properties

The FileActivatedEventArgs class has these properties.

PropertyAccess typeDescription

CurrentlyShownApplicationViewId

Read-onlyGets the identifier for the currently shown app view.

Files

Read-onlyGets the files for which the app was activated.

Kind

Read-onlyGets the activation type.

NeighboringFilesQuery

Read-onlyGets the neighboring files of the files for which the app was activated.

PreviousExecutionState

Read-onlyGets the execution state of the app before it was activated.

SplashScreen

Read-onlyGets the splash screen object that provides information about the transition from the splash screen to the activated app.

Verb

Read-onlyGets the action associated with the activated file.

 

Remarks

This object is accessed when you implement an event handler to respond to Activated events when ActivationKind is File.

Windows Store apps 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 OnFileActivated is up to your app code.

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

Note that when your app is activated for the file contract you must access the data using the StorageFile objects passed to your app through the Files property. You should not attempt to access the path of the file since your app may not have permission to the file’s location.

Examples

The OnFileActivated event handler on the Application object receives all file activation events.


Private Sub OnFileActivated(ByVal args As Windows.ApplicationModel.Activation.FileActivatedEventArgs)
      ' TODO: Handle file activation

      ' The number of files received is args.Files.Size
      ' The first file is args.Files(0).Name
End Sub

Requirements

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 Runtime apps only]

Namespace

Windows.ApplicationModel.Activation
Windows::ApplicationModel::Activation [C++]

Metadata

Windows.winmd

See also

Samples
Association launching sample
Tasks
How to handle file activation
Guidelines
Guidelines and checklist for file types and protocols
Reference
Windows.Storage
Windows.UI.Core.CoreApplicationView.Activated
Windows.UI.Xaml.Application.OnFileActivated

 

 

Show:
© 2014 Microsoft