Hi,
Using DevForce versoin 6.0.6.0 for Silverlight:
I'm starting using navigation properties in Silverlight making use of the PendingEntityResolved such when an image is requested by the parent entity (building entity, EntBuilding) i retrive the image-navigation property (EntImage):
// This is a code snipped from my view model.
// A databound blob, a Value converter in the XAML takes care of valu conversion andis proofed to work
public byte[] p_image /
{
get
{
if (p_currentItem == null) // If no item is selected return null
return null;
EntBuilding b = (EntBuilding) p_currentItem; // The type is guranteed to be EntBuilding
// Some test commented out
// var test = EntBuilding.PropertyMetadata.p_image.GetEntityReference(b);
// test.IsLoaded = false;
if (b.p_image.EntityAspect.IsPendingEntity) // always returns false!!
{
b.p_image.EntityAspect.PendingEntityResolved += OnPendingEntImageResolved;
}
return b.p_image.p_image;
}
}
private void OnPendingEntImageResolved(object sender, PendingEntityResolvedEventArgs e)
{
if (p_currentItem is EntBuilding)
RaisePropertyChanged("p_image");
}
The strange thing is that b.p_image.EntityAspect.IsPendingEntity is allways false, although it has not been loaded.
After investigating my Entity model better I notice that all not-loaded navigation propertis are having IsPendingEntity = false but GetEntityReference(xx).IsLoaded = false. The same is tro for IsPendingEntityList. It is allways true alothugh the navigatoin collectoin properties have not been loaded.
How can that be?
PS: I'm using Entity Model against INformis Dynamic Server version 11.5 without any problems until now.