Provides data when an app is activated because it is the app associated with a URI scheme name.
JavaScript: This type appears as WebUIProtocolActivatedEventArgs.
Syntax
public sealed class ProtocolActivatedEventArgs : Object, IProtocolActivatedEventArgs, IActivatedEventArgs
Attributes
- MarshalingBehaviorAttribute(Agile)
- VersionAttribute(NTDDI_WIN8)
Members
The ProtocolActivatedEventArgs class has these types of members:
Methods
The ProtocolActivatedEventArgs class inherits methods from the Object class.
Properties
The ProtocolActivatedEventArgs class has these properties.
| Property | Access type | Description |
|---|---|---|
| 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 Uniform Resource Identifier (URI) for which the app was activated. |
Remarks
This object is accessed when you implement an event handler to respond to Activated events when ActivationKind is Protocol.
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 OnActivated is up to your app code. If ActivationKind is Protocol then the interface-typed IActivatedEventArgs from OnActivated can be cast to ProtocolActivatedEventArgs.
All Application overrides involved in an activation scenario should call Window.Activate in their implementations.
Examples
The OnActivated event handler receives all activation events. The Kind property indicates the type of activation event. This example is set up to handle Protocol activation events.
public partial class App { protected override void OnActivated(IActivatedEventArgs args) { if (args.Kind == ActivationKind.Protocol) { ProtocolActivatedEventArgs protocolArgs = args as ProtocolActivatedEventArgs; // TODO: Handle protocol activation // The received URI is protocolArgs.Uri.AbsoluteUri } } }
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 |
|
Namespace |
|
|
Metadata |
|
See also
- Samples
- Association launching sample
- Tasks
- How to handle protocol activation
- Guidelines
- Guidelines and checklist for file types and URIs
- Reference
- Windows.UI.Core.CoreApplicationView.Activated
- Windows.UI.Xaml.Application.OnActivated
- URI
Build date: 2/25/2013