Silverlight requires all data retrieval to be performed asynchronously.
When you reference a navigation property that returns a collection, e.g., aCustomer.Orders, you are launching a query -- which is necessarily asynchronous.
Therefore DevForce needs a callback method to exercise when the asynchronous retrieval operation is completed. You supply this when you set up a
PendingEntityListResolved handler for the aCustomer.Orders property. That handler then receives the collection of returned child entities via the
ResolvedEntities property of its
PendingEntityListResolvedEventArgs parameter. Then you take whatever action you wanted to take once those entities were available.
For navigation properties that return a scalar result (single entity, e.g., anOrder.Customer), there is a corresponding event,
PendingEntityResolved, which is used in a similar fashion.
-------------------------
Related info: On the
EntityManager, there is a property
UseAsyncNavigation which determines whether asynchronous data retrieval is used when satisfying references to navigation properties. This property is set to
true by default in Silverlight applications;
false in other types of applications. If you wanted to write an application with both WPF and Silverlight front ends, you could set this property to
true and then write all of your controller logic to perform data operations asynchronously.
Edited by GregD - 02-Oct-2009 at 11:24am