Beispiel #1
0
        static void Main(string[] args)
        {
            ReunionApp.OnActivated += ReunionApp_OnActivated;

            if (!ReunionApp.WasProcessActivated())
            {
                Console.WriteLine("Hello World!");

                Console.WriteLine("To receive a toast, press enter...");

                Console.ReadLine();

                var content = new ToastContentBuilder()
                              .AddText("Hi! Please enter your name!")
                              .AddInputTextBox("name", "Your name")
                              .AddButton("Submit", ToastActivationType.Foreground, "submit")
                              .AddToastActivationInfo("helloConsoleArgs", ToastActivationType.Foreground)
                              .GetToastContent();

                var notif = new ToastNotification(content.GetXml());

                // Only difference here is calling the Compat API so that works down-level
                ToastNotificationManagerCompat.CreateToastNotifier().Show(notif);

                Console.WriteLine("You should try clicking the toast...");

                Console.ReadLine();
            }
            else
            {
                Console.ReadLine();
            }
        }
 static ToastNotificationManagerCompat()
 {
     // Instantiate the static code so app gets started
     ReunionApp.Initialize();
 }