Exemplo n.º 1
0
        static void Main()
        {
            AppNoStartupUri app = new AppNoStartupUri
            {
                ShutdownMode = ShutdownMode.OnExplicitShutdown
            };

            app.Startup += App_Startup;

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



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


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

            try
            {
                app.Run();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
            }
            
        }
Exemplo n.º 2
0
		static void Main()
		{
			AppNoStartupUri app = new AppNoStartupUri
			{
				ShutdownMode = ShutdownMode.OnExplicitShutdown
			};
			app.InitializeComponent();

			Program4 p = new Program4();
			p.ExitRequested += (sender, e) =>
			{
				app.Shutdown();
			};
			Task programStart = p.StartAsync();

			app.Run();
		}
Exemplo n.º 3
0
        static void Main()
        {
            AppNoStartupUri app = new AppNoStartupUri
            {
                ShutdownMode = ShutdownMode.OnExplicitShutdown
            };

            app.InitializeComponent();

            Program4 p = new Program4();

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

            app.Run();
        }
Exemplo n.º 4
0
		static void Main()
		{
			AppNoStartupUri app = new AppNoStartupUri
			{
				ShutdownMode = ShutdownMode.OnExplicitShutdown
			};
			app.InitializeComponent();
			SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());

			Program5 p = new Program5();
			p.ExitRequested += (sender, e) =>
			{
				app.Shutdown();
			};
			Task programStart = p.StartAsync();
			HandleExceptions(programStart, app);

			app.Run();
		}
Exemplo n.º 5
0
        static void Main()
        {
            var app = new AppNoStartupUri
            {
                ShutdownMode = ShutdownMode.OnExplicitShutdown
            };

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

            var p = new Program();

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

            var t = p.StartAsync();

            Handle(t);
            app.Run();
        }
Exemplo n.º 6
0
        static void Main()
        {
            AppNoStartupUri app = new AppNoStartupUri
            {
                ShutdownMode = ShutdownMode.OnExplicitShutdown
            };

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

            Program5 p = new Program5();

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

            HandleExceptions(programStart, app);

            app.Run();
        }
        //static async Task Main(string[] args)
        static void Main()
        {
            _logger = new Common.LoggerTest();
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            var app = new AppNoStartupUri
            {
                ShutdownMode = ShutdownMode.OnExplicitShutdown
            };

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

            var p = new Program();

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

            var t = p.StartAsync();

            Handle(t);
            app.Run();
        }
Exemplo n.º 8
0
 private void viewModel_CloseRequested(object sender, EventArgs e)
 {
     m_app.Shutdown();
 }