I've defined a DataTemplate in a ResourceDictionary. The template need some data (for populating a ListBox). Previously the template was a UserControl and the data was provided by setting the DataContext property.
Is there some way of using code-behind for a DataTemplate or is using an ObjectDataProvider to provide the data the only option?