Skip to content

Instantly share code, notes, and snippets.

@pnp0a03
Last active November 5, 2017 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pnp0a03/649be3291de79caf71a26834012157bd to your computer and use it in GitHub Desktop.
Save pnp0a03/649be3291de79caf71a26834012157bd to your computer and use it in GitHub Desktop.
FCU commandline option - OnActivated Override
protected override void OnActivated(IActivatedEventArgs args)
{
Frame rootFrame = Window.Current.Content as Frame;
if(ActivationKind.CommandLineLaunch == args.Kind)
{
var commandArgs = args as CommandLineActivatedEventArgs;
var operation = commandArgs.Operation;
string arguments = operation.Arguments;
string activationPath = operation.CurrentDirectoryPath;
//operation.ExitCode = arguments.Length;
if (null == rootFrame)
{
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
}
Window.Current.Content = rootFrame;
}
rootFrame.Navigate(typeof(MainPage), arguments);
Window.Current.Activate();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment