tbischel
tbischel

Reputation: 6477

WPF background worker need a dispatcher for bound data

I have all my data bound from WPF controls to properties in an object that my Window can access. When I run a backgroundworker thread, do I need a dispatcher to access these underlying properties, or since I'm not explicitly accessing the UI controls, is that handled automatically by the mechanism binding the XAML to the code properties?

Upvotes: 0

Views: 564

Answers (1)

Rob Fonseca-Ensor
Rob Fonseca-Ensor

Reputation: 15621

The WPF (but not silverlight) databinding system will automatically send INotifyPropertyChanged events to the dispatcher thread, so you can trigger these from wherever you like. INotifyCollectionChanged is not so lucky, so you'll need to dispatch any changes to an ObservableCollection yourself...

Upvotes: 2

Related Questions