private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { var mainWindow = UICommon.GetProperty("MainWindow") as MainWindow; mainWindow.FilterTasksFromThread(); }