Dynamically adding Views in Silverlight & MVVM

Posted by dvox on Stack Overflow See other posts from Stack Overflow or by dvox
Published on 2010-05-12T14:44:46Z Indexed on 2010/05/16 2:30 UTC
Read the original article Hit count: 209

Filed under:
|
|

Hi all,

I am starting to re-write my whole silverlight business application in the MVVM pattern; My first stop-point is this:

I have a page (View1) with corresponding ViewModel1 (with a property 'IEnumerable AllData');

Now, within this View, I want to have i.e. a tree-view control, in which one node will be populated with another View2;

My question is: 1. How to do it? - I can't loop through the AllData property since it is asynchronously loaded... - thus I don't know the number of View2s' to insert - I don't know how to do it from ViewModel1 :(

  1. Will I need ViewModel2 with property 'MyDataEntity CurrentData'?
    • or I can bind to AllData property from ViewModel1

Can you help me out?

Thanks

© Stack Overflow or respective owner

Related posts about mvvm

Related posts about Silverlight