(X) Hide this Sign up for the upcoming webinar: Switching on the Cloud for Silverlight by Gill Cleeren. March 23rd, 11 am PST (check your local time)
Full info | Sign up | More webinars

More from Silverlight Show

  • Daily News Digest 03/23/2011
  • Join TODAY's Free SilverlightShow Webinar: Switching on the Cloud for Silverlight! Starts at 11 am PST!
  • Targeting mobile-optimized CSS at Windows Phone 7
  • Windows Phone 7 - Detecting a Tombstone
  • New WP7 Book Coming Soon: 'Essential Windows Phone 7' by Shawn Wildermuth
Skip Navigation LinksHome / News / View News

Databinding WP7 lists to singletons with Caliburn.Micro

+ Add to SilverlightShow Favorites
0 comments   /   posted by Silverlight Show on Mar 21, 2011
(0 votes)

SilverlightShow Page for all Silverlight and Windows Phone 7 (WP7) things on TwitterJosh Earl shows how to databind to an injected list with Caliburn.Micro.

Source: Josh Earl's Blog

My current Windows Phone 7 project involves a list of data elements that will be displayed on multiple pages in the application. Rather than storing the list in isolated storage and reading it out each time one of the pages needs to display it, I’m making this list a singleton object, which will be created when the app first launches and will survive until the app closes.

The list is injected into each viewmodel that relies on it via the viewmodel’s constructor. Caliburn.Micro includes a simple IoC container that makes the injection process straightforward. Once the list has been injected into the viewmodel, I am storing the list items in a viewmodel property for display in the view.
Share


Comments

Comments RSS RSS
No comments

Add Comment

 
 

   
  
  
   
Please add 5 and 2 and type the answer here: