title: Xamarin.Forms handle notification launch (UWP)
body: <p>Xamarin documentation is a mess all over the internet but I cannot seem to find a solid example of how to handle my Xamarin.Forms application being launched from a notification or handling a notification being clicked while my application is already running. </p>
  
  <p>So I am inside of the <code>Xamarin.Forms.UWP</code> application in the <code>App.xaml.cs</code> file that handles all the UWP launching. Within the <code>OnActivated</code> method I can see that my application receives a fire and gets the proper data from my toast notification. My question is how do I pass that data back into the Xamarin.Forms instance. </p>
  
  <pre><code>protected override void OnActivated(IActivatedEventArgs args)
   {
       base.OnActivated(args);
       var _args = (args as LaunchActivatedEventArgs).Arguments;
   }
  </code></pre>
  
  <p>Custom UWP Notification Service:</p>
  
  <pre><code>ToastContent content = new ToastContent()
              {
                  Launch = "...",
                  Visual = new ToastVisual()
                  {
                    BindingGeneric = new ToastBindingGeneric()
                    {
                        Children =
                          {
                              new AdaptiveText()
                              {
                                  Text = title,
                                  HintMaxLines = 1
                              },
  
                              new AdaptiveText()
                              {
                                  Text = body
                              }
                          }
                    }
                  },
                  Actions = new ToastActionsCustom()
                  {
                      Buttons =
                      {
                          new ToastButton(acceptAction.Key, $"action={acceptAction.Value}")
                          {
                              ActivationType = ToastActivationType.Foreground
                          },
  
                          new ToastButton(declineAction.Key, $"action={declineAction.Value}")
                          {
                              ActivationType = ToastActivationType.Background
                          }
                      }
                  }
              };
  
              var toast = new ToastNotification(content.GetXml());
  
              ToastNotificationManager.CreateToastNotifier().Show(toast);
  </code></pre>
  
  <p>How do I go about sending this _args variable back into the running instance of my cross-platform application so that I can process the logic of navigating to a route, etc. </p>
  
  <p>Furthermore if I have to write some custom code to handle this I will want the code to be easy to integrate the same functionally with the Xamarin.Forms.Android app in this project as well.</p>