Recommended

Skip Navigation LinksHome / News / View News

Easily decouple your MVVM ViewModel from your Model using RX Extensions

+ Add to SilverlightShow Favorites
0 comments   /   posted by Silverlight Show on Apr 26, 2010
(0 votes)
Tags: MVVM , Michael Washington , RX Extensions , Michael Washington
In this post Michael Washington explains how to place your web service methods in your Model and simply call them from your ViewModel using RX Extensions.

With “Simplified MVVM” you can simply place your web service methods in your Model. The problem you run into, is how do you make an asynchronous web service call and fill a collection in your ViewModel? One method I have employed in the past is to pass an instance of the ViewModel to the Model, however, the problem this causes, is that you have now tightly coupled your ViewModel and your Model. It is also difficult to consume your Model from multiple ViewModels when you do it this way.

Share


Comments

Comments RSS RSS
No comments

Add Comment

 
 

   
  
  
   
Please add 8 and 1 and type the answer here:

Join the free SilverlightShow webinar 'Silverlight's Power Features: Data Binding in Action' on August 19th 2010, 10:00 am PDT.
In this session Gill Cleeren will make with a complete overview of the data binding features Silverlight 4 has to offer. He will discuss how data binding is the enabler for applying the MVVM pattern and commanding, and will end up reviewing Blend's support for data binding, including the use of design-time data. Read more | Register Now (hide this)