Windows Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ProtocolActivatedEventArgs class

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 : IProtocolActivatedEventArgs,
    IActivatedEventArgs,
    IApplicationViewActivatedEventArgs

Members

The ProtocolActivatedEventArgs class has these types of members:

Properties

The ProtocolActivatedEventArgs class has these properties.

PropertyAccess typeDescription

CallerPackageFamilyName

Read-onlyGets the package family name of the application that activated the current application.

CurrentlyShownApplicationViewId

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

Data

Read-onlyData received from the application that activated the current application.

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.

Uri

Read-onlyGets the Uniform Resource Identifier (URI) for which the app was activated.

ViewSwitcher

Read-onlyGets the view switcher object that allows you to set the view for the application.

 

Remarks

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

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 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 URI activation events.


public partial class App
{
   protected override void OnActivated(IActivatedEventArgs args)
   {
      if (args.Kind == ActivationKind.Protocol)
      {
         ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;

         // TODO: Handle URI activation
         // The received URI is eventArgs.Uri.AbsoluteUri
      }
   }
}

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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

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

Metadata

Windows.winmd

Attributes

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

See also

Object
IProtocolActivatedEventArgs
IActivatedEventArgs
IApplicationViewActivatedEventArgs
Samples
Association launching sample
Handling Contact Actions sample
Tasks
How to handle URI activation
Quickstart: Handling contact actions (XAML)
Quickstart: Handling contact actions (HTML)
Guidelines
Guidelines and checklist for file types and URIs
Reference
Windows.UI.Core.CoreApplicationView.Activated
Windows.UI.Xaml.Application.OnActivated
URI

 

 

Show:
© 2015 Microsoft