views:

215

answers:

0

Hi,

I have a class called ChangeWatcher that is used to publish events to subscribers every time an object issues a PropertyChange event. This class is used to allow my application to execute a procedure everytime an object is updated.

It is working OK but when I drive the PropertyChange of an ObservableCollection and I add a new item to the collection I have noticed that it generates two PropertyChange events. One for the "Count" property and another one that has the Propertyname equal to "Item[]".

Well there are sometimes that I need to execute some lengthy operations like to call a WCF service in response to the event and, in this case, the service is being called twice. I have changed my class so that the subscriber can define the PropertyName that will really trigger the notification, so that I it can avoid to be trigerred twice.

I am working with Silverlight 3.0 Beta and I am afraid that the PropertyName of the events raised by the ObservableCollection can change. So defining a specific PropertyName solves the problem of sending two events of the subscriber but if the PropertyName changes the subscriber will never be notified.

Is there someone that had the same problem ???? Can you help me ???

Thanks in advance

related questions