开发者

WPF background worker need a dispatcher for bound data

I have all my data boun开发者_JAVA百科d 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?


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜