FileActivatedEventArgs class

This topic has not yet been rated - Rate this topic

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

JavaScript:  This type appears as WebUIFileActivatedEventArgs.

Syntax


public sealed class FileActivatedEventArgs : Object,
    IFileActivatedEventArgs,
    IActivatedEventArgs

Attributes

MarshalingBehaviorAttribute(Agile)
VersionAttribute(NTDDI_WIN8)

Members

The FileActivatedEventArgs class has these types of members:

Methods

The FileActivatedEventArgs class inherits methods from the Object class.

Properties

The FileActivatedEventArgs class has these properties.

PropertyAccess typeDescription

Files

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

Kind

Read-onlyGets the activation type.

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 built for Windows 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.


protected override void OnFileActivated(FileActivatedEventArgs args)
{
       // TODO: Handle file activation

       // The number of files received is args.Files.Size
       // The first file is args.Files[0].Name
}

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store 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

 

 

Build date: 2/25/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.