Beispiel #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // Window_Loaded 错误处理
            try
            {
                SplashWindow.Start();
                Thread.Sleep(1000);

                MainViewModel.Initial();
                _runLedtimer.Interval = TimeSpan.FromSeconds(1);
                _runLedtimer.Start();
                SplashWindow.Stop();
                Activate();
            }
            catch (Exception ex)
            {
                SplashWindow.ShowInfo("连接PLC失败");
                Thread.Sleep(2000);
                SplashWindow.Stop();
                Application.Current.Shutdown(0);
            }
        }