Пример #1
0
        private void App_OnStartup(object sender, StartupEventArgs e)
        {
            var viewModel = new HomeViewModel();
            var window = new HomeWindow
            {
                DataContext = viewModel
            };

            window.Show();
        }
Пример #2
0
        private void App_OnStartup(object sender, StartupEventArgs e)
        {
            var window = new HomeWindow();
            var viewModel = new HomeViewModel();

            window.DataContext = viewModel;
            window.Show();

            Application.Current.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(AppDispatcherUnhandledException);

            if (HasRun() == false)
            {
                FirstRun();
            }
        }