This might not be directly related to your problem but I thought I'd mention it here for completeness. I also just happened to be looking at this kind of thing so it's fresh in my mind.
It is possible to disable these notifications. The following code will add 10 child "OrderDetail" rows to a RelatedEntityList without raising any change notifications:
//The 'parent' entityvar order = new Order();
//Disable change notifications on the parent entity's group (maybe check if it is already // disabled so you don't mess with the existing state?) order.EntityAspect.EntityGroup.ChangeNotificationEnabled = false;
//Get the RelatedEntityList RelatedEntityList<OrderDetail> entityList = order.OrderDetails;
//Add 10 detail rows - none of these will trigger a CollectionChanged event for (var i = 0; i < 10;i++ ) entityList.Add(new OrderDetail());
//Re-enable notifications for future operations order.EntityAspect.EntityGroup.ChangeNotificationEnabled = true; |
However, I'm not sure that this would actually help you out if your UI is bound to the related entity list. You basically would have added 10 items behind its back.....so they wouldn't show up. Perhaps you could somehow force the UI to 'refresh' itself after you did the bulk loading. Or you may just need to wait until an AddRange() method gets added.
You can read more about EntityGroup.ChangeNotificationsEnabled on the
Listen for Changes wiki page. I'll specifically quote this note/warning: