public BackgroundThread(DisposableCommand command_to_execute, IWorkerThread worker_thread) { this.worker_thread = worker_thread; worker_thread.DoWork += (sender, e) => command_to_execute.run(); worker_thread.Disposed += (sender, e) => command_to_execute.Dispose(); }