> For the complete documentation index, see [llms.txt](https://docs.radicalframework.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.radicalframework.com/concepts/observers/memento-observer.md).

# MementoObserver

A memento observer, or monitor, is an instance of the `MementoObserver` class that observes changes occurring to a `ChangeTrackingService` instance.

```csharp
var memento = new ChangeTrackingService();
var monitor = MementoObserver.Monitor(memento);
```

We can use a monitor to trigger, for example, the `CanExecuteChanged` event of a `ICommand` interface implementation:

```csharp
var memento = new ChangeTrackingService();
var monitor = MementoObserver.Monitor(memento);

var saveCommand = DelegateCommand.Create()
    .OnCanExecute(state => memento.IsChanged)
    .OnExecute(state => /* execute the command */)
    .AddMonitor(monitor);
```

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.
