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.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the files for which the app was activated. | |
| Read-only | Gets the activation type. | |
| Read-only | Gets the execution state of the app before it was activated. | |
| Read-only | Gets the splash screen object that provides information about the transition from the splash screen to the activated app. | |
| Read-only | Gets 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 |
|
|
Metadata |
|
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