//}]}
        private async void OnExit(object sender, ExitEventArgs e)
        {
//{[{
            await _host.StopAsync();

            _host = null;
//}]}
        }
        private async void OnStartup(object sender, StartupEventArgs e)
        {
//{[{
            AddConfiguration(e.Args);
            _host = SimpleIoc.Default.GetInstance <IApplicationHostService>();
            await _host.StartAsync();

//}]}
        }
Пример #3
0
        private async void OnStartup(object sender, StartupEventArgs e)
        {
            // Read more about sending local toast notifications from desktop C# apps
            // https://docs.microsoft.com/windows/uwp/design/shell/tiles-and-notifications/send-local-toast-desktop
            //
            // Register AUMID, COM server, and activator
            DesktopNotificationManagerCompat.RegisterAumidAndComServer <ToastNotificationActivator>("LightApp");
            DesktopNotificationManagerCompat.RegisterActivator <ToastNotificationActivator>();

            AddConfiguration(e.Args);
            _host = SimpleIoc.Default.GetInstance <IApplicationHostService>();
            if (e.Args.Contains(DesktopNotificationManagerCompat.ToastActivatedLaunchArg))
            {
                // ToastNotificationActivator code will run after this completes and will show a window if necessary.
                return;
            }

            await _host.StartAsync();
        }