PostSharpAPI ReferencePost­Sharp.​Patterns.​ModelNotify­Property­Changed­ServicesSuspend­Events
Open sandboxFocus

NotifyPropertyChangedServices.SuspendEvents Method


Suspends the raising of PropertyChanged events for the current thread.

public static bool SuspendEvents()
Type Description

true if events were suspended as a result of the current method call, false if events were already suspended before.


The ResumeEvents() method should be invoked as many times as the SuspendEvents() method has been invoked, regardless of the return value of the SuspendEvents() method. Failing to do so results in events not being fired at all and potentially in memory leaks as collected events hold strong references.

When events are suspended, existing objects have PropertyChanged events collected into an event buffer (multiple changes are treated as one).

When events are suspended, newly created object do not have PropertyChanged events collected.

When events are suspended, all object do not have PropertyChanging events collected.