MVVM Good Design. DataSet or a RowViewModel
Posted
by LnDCobra
on Stack Overflow
See other posts from Stack Overflow
or by LnDCobra
Published on 2010-04-17T21:49:33Z
Indexed on
2010/04/17
21:53 UTC
Read the original article
Hit count: 574
I have just started learning MVVM and having a dilemna.
If I have a a main ViewModel and inside this model I have a number of datasets. Now should I be creating a new ViewModel for each row inside the dataset? Or expose the DataSet itself as a DependencyProperty?
For now the dataset has about 20 rows inside it, and the thought of iterating through each row to create a ViewModel binding to each row.... might not be the best option for performance reasons and memory reasons in the future, like when there are 1000+ rows.
Should I still go ahead and create a RowViewModel and iterate through the dataset? And have an ObservableCollection of it or just expose the dataset?
Any help would be greatly appreciated.
© Stack Overflow or respective owner