Binding DataField to a collection
Here is something I found interesting browsing the silverlight forums. Assuming we are editing a object and we are in editmode in the DataForm
If we want to bind a property to a datafield we do something like
<dataFormToolkit:DataField Label=”FirstName”>
<TextBox Text=”{Binding FirstName, Mode=TwoWay}”/>
</dataFormToolkit:DataField>
buf if the property is a collection doing something similar wont work( the control will not be enabled)
<dataFormToolkit:DataField Label=”Skills” >
<ListBox ItemsSource=”{Binding Skills }”></ListBox>
</dataFormToolkit:DataField>
looks like we need to do something like this, specify the DataContext on the DataField
<dataFormToolkit:DataField Label=”Skills” DataContext=”{Binding Skills}” >
<ListBox ItemsSource=”{Binding }”></ListBox>
</dataFormToolkit:DataField>
