Skip to content

Commit c95727e

Browse files
committed
fix: Crash when activating via protocol
1 parent 3593514 commit c95727e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/App.xaml.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace Bluebird;
1+
using WinRT;
2+
3+
namespace Bluebird;
24

35
sealed partial class App : Application
46
{
@@ -38,14 +40,14 @@ protected override void OnActivated(IActivatedEventArgs args)
3840
{
3941
if (args.Kind == ActivationKind.Protocol)
4042
{
41-
ProtocolActivatedEventArgs ProtocolEventArgs = args as ProtocolActivatedEventArgs;
43+
ProtocolActivatedEventArgs ProtocolEventArgs = args.As<ProtocolActivatedEventArgs>();
4244
StartupUrl = ProtocolEventArgs.Uri.ToString();
4345
UnifiedArgumentStartup();
4446
}
4547

4648
if (args.Kind == ActivationKind.CommandLineLaunch)
4749
{
48-
CommandLineActivatedEventArgs CommandEventArgs = args as CommandLineActivatedEventArgs;
50+
CommandLineActivatedEventArgs CommandEventArgs = args.As<CommandLineActivatedEventArgs>();
4951
CommandLineActivationOperation operation = CommandEventArgs.Operation;
5052
string input = operation.Arguments;
5153

0 commit comments

Comments
 (0)