MementoObserver
A memento observer, or monitor, is an instance of the MementoObserver
class that observes changes occurring to a ChangeTrackingService
instance.
We can use a monitor to trigger, for example, the CanExecuteChanged
event of a ICommand
interface implementation:
The above code is not very different from manually attaching the TrackingStateChanged
event of the ChangeTrackingService
instance and manually calling the RaiseCanExecuteChanged
method of the DelegateCommand
instance, it is simply more concise and easier to maintain.
Last updated