DevForce Help Reference
PendingEntityResolved Event
Example 


Fired when a pending asynchronous navigation has completed.
Syntax
'Declaration
 
Public Event PendingEntityResolved As EventHandler(Of PendingEntityResolvedEventArgs)
'Usage
 
Dim instance As EntityAspect
Dim handler As EventHandler(Of PendingEntityResolvedEventArgs)
 
AddHandler instance.PendingEntityResolved, handler
public event EventHandler<PendingEntityResolvedEventArgs> PendingEntityResolved
Event Data

The event handler receives an argument of type PendingEntityResolvedEventArgs containing data related to this event. The following PendingEntityResolvedEventArgs properties provide information specific to this event.

PropertyDescription
ResolvedEntity The entity fetched by the asynchronous navigation.  
Example
private OrderSummary _anOrder;

public void AsyncGetCustomerForOrder() {

  DomainModelEntityManager mgr = new DomainModelEntityManager();

  // Turn on async navigation.  This is a readonly property in Silverlight.
  mgr.UseAsyncNavigation = true;

  // Assume we have an OrderSummary in cache.
  // Navigate to the order's Customer property.
  // If UseAsyncNavigation is true and the customer isn't already in cache
  // the IsPendingEntity flag will be on.

  var cust = _anOrder.Customer;
  Assert.IsTrue(cust.EntityAspect.IsPendingEntity);

  // Set up a handler to tell us when this entity has been retrieved.
  // Note the handler is on the pending entity itself.
  cust.PendingEntityResolved += PendingEntityResolvedHandler;
}

private void PendingEntityResolvedHandler(object sender, PendingEntityResolvedEventArgs args) {
  // The entity has been retrieved.
  Assert.IsFalse(_anOrder.Customer.EntityAspect.IsPendingEntity);
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityAspect Class
EntityAspect Members

Send Feedback