//public void Progress() { // Thread thread = new Thread(new ThreadStart(() => // { // for (int i = 0; i <= 100; i++) // { // if (CurrentBoltClient.boltData.IsCanStartCal == true) // { // progressWindow.progressBar1.Dispatcher.BeginInvoke((ThreadStart)delegate { progressWindow.progressBar1.Value = 100; }); // Thread.Sleep(1000); // break; // } // progressWindow.progressBar1.Dispatcher.BeginInvoke((ThreadStart)delegate { progressWindow.progressBar1.Value = i; }); // Thread.Sleep(300); // } // // this.Close(); // })); // thread.Start(); //} /// <summary> /// 初始化数据源、UI、绑定对象 /// </summary> private void InitObjects() { BoltComboList.ItemsSource = null; CurrentBolt = new BoltModel(); Bolt_Para.DataContext = CurrentBolt; BuildBoltComboList(-1); CurrentBoltClient = new Bolt(); CurrentBoltClient.USTBDataInit(); Proj_Name.DataContext = Proj_name; DateTime dateTime = DateTime.Now; DateTime start = dateTime.AddDays(-7); DateTime end = dateTime.AddDays(1); EndDateCal.SelectedDate = end; EndTimeText.Text = end.Year.ToString() + "-" + end.Month.ToString() + "-" + end.Day.ToString(); StartDateCal.SelectedDate = start; StartTimeText.Text = start.Year.ToString() + "-" + start.Month.ToString() + "-" + start.Day.ToString(); }