Пример #1
0
		static void Main()
		{
			AppNoStartupUri app = new AppNoStartupUri
			{
				ShutdownMode = ShutdownMode.OnExplicitShutdown
			};
			app.InitializeComponent();
			SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());

			Program6 p = new Program6();
			p.ExitRequested += (sender, e) =>
			{
				app.Shutdown();
			};

			Task programStart = p.StartAsync();
			HandleExceptions(programStart, app);

			app.Run();
		}
Пример #2
0
        static void Main()
        {
            AppNoStartupUri app = new AppNoStartupUri
            {
                ShutdownMode = ShutdownMode.OnExplicitShutdown
            };

            app.InitializeComponent();
            SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());

            Program6 p = new Program6();

            p.ExitRequested += (sender, e) =>
            {
                app.Shutdown();
            };

            Task programStart = p.StartAsync();

            HandleExceptions(programStart, app);

            app.Run();
        }