Reputation: 7043
I have a DLL that I can use to pull the following information about individuals from a database:
-first name
-last name
-age
-name of task
-progress of that task (percentage)
I'd like to display that information with WPF (or other technology if that makes it much easier) in my Windows Application. Every 5 seconds, the application will use the DLL to get the new info and update the display. I want to display first name, last name, age etc in its own column, and the number of individuals will change over time.
I think I can figure out how to use the DLL in C#, but I'm having problems finding info about dynamically adding/removing controls from a window in WPF.
Any pointers are appreciated!
Upvotes: 1
Views: 333
Reputation: 4815
You could also look at PRISM, aka CAG, which can also be used for Silverlight 3. There is a printable set of docs here. It looks complicated but you can just use the bits you want.
Basically, whichever way you do MVVM, you'll probably end up with some kind of Grid in your View which is databound to some kind of ObservableCollection in your ViewModel which gets its data from the Model, such that any changes to the ObsColln just appear in the UI without you doing anything else. Nice.
Upvotes: 0
Reputation: 12628
You probably want to use a design pattern such as MVVM(Model-View-ViewModel) to abstract DLL (which knows nothing about WPF) and your main application.
This MSDN article goes in to detail about how to use it to work with collections of data and use databinding to automatically update.
Upvotes: 1