The elegant way of doing this is to create a list of only the data (such as directories) you are interested in and pass it to the BackgroundWorker's DoWorkEventArgs
.
You should never pass Forms controls to a BackgroundWorker; doing that can cause cross-thread exceptions, crash your UI, and cause race conditions as both the UI and worker try to use the same data. Only pass the data you actually need to another thread.