I'm building a WPF photo viewing application, and trying to get a handle on threading. I've asked about this before in this forum -- and although everyone's reading suggestions have been good, I'm still having a hard time putting everything together.

I have two listBoxes -- gallerySelector stores a the names of folders with which images are stored. PhotosListBox is populated with the photos in the directory specified by gallerySelector.

The program is based on Microsoft's Photo Viewer WPF demo app (http://msdn.microsoft.com/en-us/library/ms771331.aspx)

I want to make the gallerySelector more responsive (so you can arrow up and down through all the folders very quickly -- without having to wait for PhotosListBox to load alll the images), so I thought I'd try threading once again. But I'm failing miserably. Of course, I'm getting the following error message:

Code:
"The calling thread cannot access this object because a different thread owns it."

Code:
private void gallerySelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
        ThreadStart gallerySelectionThread = new ThreadStart(new ThreadStart(delegate()
             {
                  this.Photos.Path = Environment.CurrentDirectory + "\\images\\" + gallerySelector.SelectedItem;
                  PhotosListBox.SelectedIndex = 0;
             }
       ));
     Thread galleryThread = new Thread(gallerySelectionThread);
     galleryThread.SetApartmentState(ApartmentState.STA);
     galleryThread.Start();
 }
where Photos is an ObservableCollection, described as:

Code:
public class PhotoCollection : ObservableCollection<Photo>
    {
        public PhotoCollection() { }
        public PhotoCollection(string path) : this(new DirectoryInfo(path)) { }
        public PhotoCollection(DirectoryInfo directory)
        {
            _directory = directory;
            Update();
        }
        public string Path
        {
            set
            {
                _directory = new DirectoryInfo(value);
                Update();
            }
            get { return _directory.FullName; }
        }
        public DirectoryInfo Directory
        {
            set
            {
                _directory = value;
                Update();
            }
            get { return _directory; }
        }
        private void Update()
        {
            this.Clear();
            try
            {
                foreach (FileInfo f in _directory.GetFiles("*.jpg"))
                    Add(new Photo(f.FullName));
            }
            catch (DirectoryNotFoundException)
            {
                System.Windows.MessageBox.Show("No Such Directory");
            }
        }
        DirectoryInfo _directory;
    }
Would it work better to move the threading code into the ObservableClass definition? In addition, it would be great to populate the PhotosListBox item-by-item, so they would be inserted into the PhotosListBox as they are loaded and rendered.

I'll be ecstatic if I can get this working -- I appreciate any help anyone can give me. Thanks!