LoadOperation.Completed versus callback in DomainContext.Load ()

Using Silverlight 3 with RIA: what's the difference between a LoadOperation.Completed event and using a callback through the DomainContext.Load method? Both work asynchronously and both provide access to LoadOperation. When / why should I use one over the other?

Thank: -)

+3
source share
2 answers

There is no difference; 2 options are offered for flexibility. Many times, a callback will suffice, but if you return LoadOperation from a method, the caller can select a subscription.

, , Completed, - . , .

+2

, . . , , , , , .

context.Load<EntityType>(query).Completed += (lo, args) =>
{
   myGrid.ItemsSource = ((LoadOperation) lo).Entities;
}

, .

!

+2

Source: https://habr.com/ru/post/1736323/


All Articles