June CTP TreeView.ItemsSource no longer works with IEnumerable. Bug?

Discussion June CTP TreeView.ItemsSource no longer works with IEnumerable. Bug?

  • Monday, July 10, 2006 3:26 AM
     
     

    I'm setting the ItemsSource on a TreeView controls like this:

    public IEnumerable ItemsSource

    {

          get

          {

                return treeView.ItemsSource;

          }

          set

          {

                treeView.ItemsSource = value;

          }

    }

    I'm pretty sure this was working in the May CTP, but now it doesn't work unless I do this:

    public IEnumerable ItemsSource

    {

          get

          {

                return treeView.ItemsSource;

          }

          set

          {

                ObservableCollection<object> theCollection = new ObservableCollection<object>();

                foreach (object item in value)

                {

                      theCollection.Add(item);

                }

     

                treeView.ItemsSource = theCollection;

          }

    }

    Looks like a bug.