public MainWindow() { InitializeComponent(); try { clsLogger.WriteToLogFile("Initialization of Main Window started."); dtWebsiteList.Columns.Add("Remark", typeof(string)); dtWebsiteList.Columns.Add("Live Viewers", typeof(int)); dtWebsiteList.Columns.Add("Max Viwers", typeof(int)); dtWebsiteList.Columns.Add("Status", typeof(string)); dtWebsiteList.Columns.Add("Refresh Time", typeof(int)); dtWebsiteList.Columns.Add("Match", typeof(int)); dtWebsiteList.Columns.Add("Retry Count", typeof(int)); dtWebsiteList.Columns.Add("Website Link", typeof(string)); dtWebsiteList.Columns.Add("Find Regex", typeof(string)); dtWebsiteList.Columns.Add("TStatus", typeof(string)); dtLiveHistory.Columns.Add("Remark", typeof(string)); dtLiveHistory.Columns.Add("Live Viewers", typeof(int)); dtLiveHistory.Columns.Add("Date_Time", typeof(DateTime)); DataGridHistory.ItemsSource = dtLiveHistory.DefaultView; dataGridWebsiteList.ItemsSource = dtWebsiteList.DefaultView; Thread LogDeleteThread = new Thread(() => DeleteLog()); LogDeleteThread.Name = "DeleteLog"; LogDeleteThread.Start(); Thread AutoLogSaveThread = new Thread(() => AutoLogSave()); AutoLogSaveThread.Name = "AutoLogSave"; AutoLogSaveThread.Start(); clsLogger.WriteToLogFile("Initialization of Main Window Finished."); } catch (Exception ex) { clsLogger.WriteToLogFile("Error in initialization of Main Window : " + ex.Message); } }