public HomePage() { InitializeComponent(); StateMachine_NotInit(); GetVideoDevices(); CurrentDevice = VideoDevices[0]; Cb_Camera.SelectedIndex = 0; StartCamera(); //Initial Random string // ---Create a Output_File_Name Randomly. Output_File_Name = _randomGenerator.Random_Output_File_Name(); Tb_Save_Result.Text = Output_File_Name[0]; // string TempStr = Paras.LoadAllParameters(); if (TempStr == "ERROR") { MessageBox.Show("Error105: MyConfiguration.LoadAllParameters() get error"); } Lb_Threshold.Content = Paras.Threshold_Trigger.Value; // Products.LoadProductLists_Str(); TrayIDList = Products._ProductLists_Str; Cb_Recipe.SelectedIndex = 2; // Btn_Auto_Click(null, null); // Dt_Modbus.Interval = TimeSpan.FromMilliseconds(int.Parse(Paras.Timer_Interval_Modbus.Value)); Dt_Modbus.Tick += Dt_ModbusTicker; Dt_Modbus.Stop(); // Dt_StateMachine.Interval = TimeSpan.FromMilliseconds(int.Parse(Paras.Timer_Interval_StateMachine.Value)); Dt_StateMachine.Tick += Dt_StateMachineTicker; Dt_StateMachine.Stop(); // this.DataContext = this; }