public void AppLoaded() { Xinjie = new ThingetPLC(); ScanA = new Scan(); ScanB = new Scan(); ReadParameter(); ScanA.ini(ScanAPortCom); ScanA.Connect(); ScanB.ini(ScanBPortCom); ScanB.Connect(); dispatcherTimer.Tick += new EventHandler(DispatcherTimerAction); dispatcherTimer.Interval = new TimeSpan(0, 0, 1); ReadRecordFromFile(); dispatcherTimer.Start(); }