protected override void OnActivated(IActivatedEventArgs args)
{
base.OnActivated(args);
// Window management
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame();
Window.Current.Content = rootFrame;
}
switch (args.Kind)
{
case ActivationKind.VoiceCommand:
{
break;
}
case ActivationKind.Protocol:
{
// Code specific to launch for results
var command = args as ProtocolActivatedEventArgs;
if (command.Uri.ToString().StartsWith("uridemo://"))
{
// Open the page that we created to handle activation for results.
rootFrame.Navigate(typeof(MainPage), command);
}
else
{
//.....
}
break;
}
}
// Ensure the current window is active.
Window.Current.Activate();
}