ChangeMonitor.OnChanged(Object) Method

Definition

Called by derived classes to raise the event when a dependency changes.

protected void OnChanged (object state);

Parameters

state
Object

The data for the change event. This value can be null.

Remarks

Typically, the OnChanged method is called when dependency changes occur. The OnChanged method is also invoked when a change-monitor instance is disposed but the disposal occurs only if the callback has not already been invoked.

If the OnChanged method is called before the NotifyOnChanged method is called, the state data from the call to the OnChanged method is saved by the cache implementation. Also, the callback to the OnChangedCallback method is invoked immediately when the NotifyOnChanged method is invoked.

Applies to

Produk Versi
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

See also