//Constructors---------------------------------------------------------------------------------------------------------// public MainWindow() { this.FormClosePending = false; appSettings = new AppSettings(); appUtilities = new AppUtilities(appSettings); appPort = new AppComPort(); appPort.ReadTimeout = 5; appBackgroundTask = new AppBackgroundTask(appSettings, appUtilities, appPort); appMainService = new AppMainService(appSettings, appUtilities, appBackgroundTask); InitializeComponent(); readAppSettingsFromXml(); appMainService.BackgroundProgress += updateOnScanProgress; appMainService.BackgroundCancelled += updateOnScanCancelled; }