diff --git a/src/Calculator/App.xaml.cs b/src/Calculator/App.xaml.cs index 78849c76..342e6851 100644 --- a/src/Calculator/App.xaml.cs +++ b/src/Calculator/App.xaml.cs @@ -73,25 +73,24 @@ namespace CalculatorApp protected override void OnActivated(IActivatedEventArgs args) { - if (args.Kind == ActivationKind.Protocol) + if (args.Kind != ActivationKind.Protocol) return; + + if (args.IsSnapshotProtocol()) { - if (args.IsSnapshotProtocol()) - { - var protoArgs = (IProtocolActivatedEventArgs)args; - OnAppLaunch(args, - new SnapshotLaunchArguments - { - ActivityId = protoArgs.Uri.GetActivityId(), - LaunchUri = protoArgs.Uri - }, - false); - } - else - { - // handle any unknown protocol launch as a normal app launch. - OnAppLaunch(args, null, false); - } + var protoArgs = (IProtocolActivatedEventArgs)args; + OnAppLaunch(args, + new SnapshotLaunchArguments + { + ActivityId = protoArgs.Uri.GetActivityId(), + LaunchUri = protoArgs.Uri + }, + false); } + else + { + // handle any unknown protocol launch as a normal app launch. + OnAppLaunch(args, null, false); + } } private void OnAppLaunch(IActivatedEventArgs args, object arguments, bool isPreLaunch)