person

person

  • NA
  • 96
  • 0

wpf ItemsSource

Sep 2 2009 5:31 AM
Hi,

I have a user control that i embed into a WPF application by doign this...

<DataTemplate>
<UserControls:WorkLine/>
</DataTemplate>

In the code between i create an Observable Collection and use this as the WorkLines itemssource.

this.workLine.ItemsSource = <MyobservbleCollection>;

My question is, how from 'WorkLine' code behind do I get the values in which this itemssource is made up off? I have bound the contents of workline to be the values of the itemssource though since this data changes I would like to iterate it in WorkLine to search for specific data.

foreach( string s in workline.itemsSource )
{
       Do something;
}

Is this possible at all?

Thanks in advance

Urema.

Answers (2)