Skip to main content

Posts

Showing posts from April, 2011

Handeling Silverlight Async Calls

As it is the case in most of silver light Service Calls You must call them asynchronously So if you normally  have a method in your model class that returns a value from a method on a service you need to wait until the Call back is complete ok how we gonna do that lets check : suppose the model is like this Notice the GetAllUsers Method Takes an even handler as an argument Lets look at what should be a viewmodel call to this method “Refer To MVVM Pattern for more” So what is going to happen when I call the GetAllUsers from the ViewModel Answer is simple the model register the eventhandler sent from the ViewModel to the Async Call Event and calls the MethodAsync and the callback will be handled in the ViewModel AKA the Class who called the Model //Normally you would have users as a I