WPF Binding individual text boxes to an array
If my programmer creates a .dll that I can reference in my WPF project, and his .dll contains an array or collection of continuously changing data, what is the best way for m开发者_JAVA百科e to update many individual controls on my WPF form?
- The controls will be objects like textBlocks...
- The .dll can contain any type of data object for my program to access, and expose any properties necessary for effective connections to my controls...
Can I bind each control to individual array elements, or will I need a more sophisticated collection object?
What would be the best way to distribute the data to each control if binding won't work?
I'm not sure what exactly you're asking. But if you want to update a collection of data in your view. I would use an ObservableCollection http://msdn.microsoft.com/en-us/library/ms668604.aspx. It automatically notifies your view of changes to the collection. So the easiest way is to expose the data as an ObservableCollection from your dll's and bind them to your views.
精彩评论