Esempio n. 1
0
        public override void OnActivated(string arguments, NotificationUserInput userInput, string appUserModelId)
        {
            Application.Current.Dispatcher.Invoke(delegate
            {
                _logger.Info("OnActivated Invoked");
                if (arguments.Length == 0)
                {
                    return;
                }

                // Parse the query string (using NuGet package QueryString.NET)
                var args = QueryString.Parse(arguments);

                // See what action is being requested
                switch (args["action"])
                {
                case "open":
                    _logger.Info("captured open");
                    OpenUri("https://www.brave.com/");
                    Application.Current.Shutdown();
                    break;

                case "close":
                    _logger.Info("captured dismiss");
                    Application.Current.Shutdown();
                    break;

                default:
                    break;
                }
            });
        }
Esempio n. 2
0
 /// <summary>
 /// This method will be called when the user clicks on a foreground or background activation on a toast. Parent app must implement this method.
 /// </summary>
 /// <param name="arguments">The arguments from the original notification. This is either the launch argument if the user clicked the body of your toast, or the arguments from a button on your toast.</param>
 /// <param name="userInput">Text and selection values that the user entered in your toast.</param>
 /// <param name="appUserModelId">Your AUMID.</param>
 public abstract void OnActivated(string arguments, NotificationUserInput userInput, string appUserModelId);