Tech Off Post

Single Post Permalink

View Thread: Silverlight 4 : ItemSource vs DataContext
  • User profile image
    turrican

    I tried to read about these two, ItemSource and DataContext but I still do not get it. Using Silverlight 4... having a custom control, a ListBox... When I attach some ObservableCollection<T> to the listBox1.ItemSource, it works and shows up.

    When I attach some ObservableCollection<T> to the listBox1.DataContext, it also works and shows up.

     

    So, which one should I use? o.O

     

    Thanks.