PostSharp 5.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Model Namespace / Notify­Property­Changed­Services Class / Notify­Property­Changed­Services Methods / Notify­Property­Changed­Services.​Suspend­Events Method

NotifyPropertyChangedServices.SuspendEvents Method

Suspends the raising of PropertyChanged events for the current thread.

Namespace:  PostSharp.Patterns.Model
Assembly:  PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 5.0.55.0 (5.0.55.0)
Syntax
C#
public static bool SuspendEvents()

Return Value

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

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.

When events are suspended, they are still being collected in the event buffer, but the buffer is not flushed.

See Also