views:

31

answers:

1

Hello. In looking through samples I have seen a number of examples where it is possible to present data within a wpf applicaiton by binding to collections. However I was wondering is it possible to write to a collection from an applicaiton. Say for example i have 2 or more fields such as names and I wanted to have hte ability to add up to three names in my application ( all stored in memory). Will collections serve this purpose. In the past with asp.net I have done this by creating data tables and storing values on the fly or during the session. I am trying to learn WPF and I was wondering if collections work in the same fashion?

If so could you please post an example or point me to references that show examples of this?

Thank you in advance.

+1  A: 

Use ObservableCollection as a datasource if you want UI to update on the changes you made to collection from your code.

See ObservableCollection<(Of <(T>)>) Class It also contains quite a good sample.

Andrii V
thanks for the pointer I have read this one before and while it explained observable collections it did not provide any samples of how to write to one. I did however find another link which explains the collections in more detail as well as how to write to one. Thanks http://msdn.microsoft.com/en-us/library/ms752347.aspx
randyc