windows phone 7 - ViewModel or Model binding with Caliburn.Micro -


This is more of an MVVM question than a caliburn question, but it is related to how I can complete it with calibern I am

I'm new to Sliverlight / WP7 development, please tell me if I am not describing myself enough.

I have caliburn.micro properly for a WP7 app with phone container / plain container and viewables etc. The problem I'm having is to pair the model's screen properly. For example, I have the following model:

  summary item {int id string name string description}   

And related view-models:

  Summary ViewModel: conductor and lieutenant; Skyline & gt; compilation. An Active {Observeable Collection & lt; Summary Atom & gt; SummaryItems; OnInitialize () {summary item = // API call item to reload}}   

More views:

  & lt; ListBox x: Name = "SummaryItems" height = "617" horizontal alignment = "left" vertical alignment = "top" width = "468" background = "transparent" & gt; & Lt; ListBox.ItemTemplate & gt; & Lt; DataTemplate & gt; & Lt; Button width = "460" height = "120" & gt; & Lt; Button.Content & gt; & Lt; StackPanel Orientation = "horizontal" height = "120" width = "400" & gt; & Lt; Text block text = "{binding id}" height = "120" font system = "40" width = "350" /> & Lt; TextBlock Text = "{binding name}" height = "120" font sizes = "40" width = "350" /> & Lt; Text block text = "{binding description}" fontisystem = "40" width = "50" textilement = "right" /> & Lt; / StackPanel & gt; & Lt; /Button.Content> & Lt; / Button & gt; & Lt; Content Control Cal: See. Model = "{binding}" vertical content element = "statchch" horizontal content element = "stretch" /> & Lt; / DataTemplate & gt; & Lt; /ListBox.ItemTemplate> & Lt; / ListBox & gt;   

My question is, to force a collection of model objects, what would you use in navigation to see in silver light / caliberning correctly. As you can see, when someone clicks on a button, I call another API on the next view-model so that he can get item data and shoot it on the screen. However, I can not see items on the screen using that listbox code. I have tried using ItemsSource = SummaryItems, and that does not seem to be located but it is how seutp sampling is located. I have found in the samples that item property is used on view modal and I am not sure how this model integrates with object.

I'm probably not clear how the binding works in all these situations and how does Calibern integrate in it. Can someone tell me in the right direction?

Any help would be greatly appreciated thanks!

Sean

You need to add items instead of your obligation to call Creating a new supervision collection:

  Summary ViewModel: Conductor & lt; Skyline & gt; compilation. One Process {Private Redoni Observable Collection & lt; Summary Atom & gt; _items; Public supervision qualification & lt; SummaryAttempt & gt; Summary {Received {Return_Items; }} Observable Collection & lt; SummaryAttempt & gt; SummaryItems; Public Summary ViewModel () {_items = New Observational Collection & lt; Summary item & gt; (); } Secure Override Start Zero () {var items = myRestCall (); SummaryItems.Clear (); Foreign objects (summaries optimum in item) {summary} Add (s); }}}    

Comments