Example #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);
            }
            
        }
Example #2
0
        public void Start()
        {
            var viewModel = new MainViewModel();

            viewModel.CloseRequested += viewModel_CloseRequested;
            viewModel.Initialize();

            var mainForm = new MainWindow();

            mainForm.Closed += (sender, e) => { viewModel.RequestClose(); };

            mainForm.DataContext = viewModel;
            mainForm.Show();
            m_app.Run();
        }
Example #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();
		}
Example #4
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();
        }
Example #5
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();
		}
Example #6
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();
        }
Example #7
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();
        }