I have a read only object that can be modified internally, and when this happens I want any bound controls on the form to display the new property values. This is easy to do if the object belongs to a read only collection by calling ResetItem (or OnListChanged), but I can't work out how to do it for a single read only object.
Does anyone know how to do this?
If a property changes, the object should raise a PropertyChanged event as defined by INotifyPropertyChanged.
ReadOnlyBase doesn't implement this interface because read-only objects are read-only, and thus not intended to be changed.
If you have a changing read-only object, then you have two options:
Rocky, thanks for the advice.
Just to clarify why my read-only objects do change, my project has quite a few read-only objects for display or selection purposes. When an editable object is saved I use the channel events (in ActiveObjects) to notify any related objects of the change so they can update themselves internally rather than do a refresh from the database. I find this method works really well and improves perfomance significantly when using a slower network link to the database. So in this sense, read-only means you can't update the object's properties, but it can still change.
Your first suggestion looks like the way to go - quick and simple. Thanks again.
Copyright (c) Marimer LLC