NotifyPropertyBase
Provides property-changing and property-changed notifications with nested suspension. A property-changed notification is coalesced while suspended, but each resume clears it even if another suspension remains.
Definition
Namespace:Telerik.WinControls.Data
Assembly:Telerik.WinControls.dll
Syntax:
public class NotifyPropertyBase : INotifyPropertyChangingEx, INotifyPropertyChanged
Inheritance: objectNotifyPropertyBase
Derived Classes:
Implements:
Constructors
public NotifyPropertyBase()
Properties
Gets whether one or more notification suspensions are active.
[Browsable(false)]
public virtual bool IsSuspended { get; }
Methods
Raises the PropertyChanged event
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
A PropertyChangedEventArgs instance containing event data.
Raises the PropertyChanged event
protected void OnPropertyChanged(string propertyName)
The name of the property
Raises the PropertyChanging event. Note: This method is called even when the notifications are suspended.
protected virtual void OnPropertyChanging(PropertyChangingEventArgsEx e)
A PropertyChangingEventArgsEx instance containing event data.
This method is called right befor the PropertyChanged event is fired.
protected virtual void ProcessPropertyChanged(PropertyChangedEventArgs e)
This method is called right before the PropertyChanging event is fired. Note: If IsSuspended is true, this method is not called.
protected virtual void ProcessPropertyChanging(PropertyChangingEventArgsEx e)
Resumes notifications with change notification enabled; pending notification data is cleared even if another suspension remains active.
public bool ResumeNotifications()
true if this call ended the outermost suspension; false if notifications were not suspended or
another suspension remains active.
Decrements the suspension count and raises the pending property-changed notification only when this call ends the outermost suspension. Pending notification data is cleared on every successful resume, including when another suspension remains active.
public virtual bool ResumeNotifications(bool notifyChanges)
true to raise the pending notification if this call ends the outermost suspension; false to
discard it. A successful resume clears pending notification data even if a nested suspension remains.
true if this call ended the outermost suspension; false if notifications were not suspended or
another suspension remains active.
General method for setting the value of the field related to the property that is modified. This method confirms that the old and new values are different, then fires the PropertyChanging event, then sets the given value to the supplied field, and fires the PropertyChanged event. Note: If the PropertyChanging event is canceled, the last two actions are not performed.
protected virtual bool SetProperty<T>(string propertyName, ref T propertyField, T value)
The name of the property, that will appear as propertyName in the PropertyChanging and PropertyChanged event args.
propertyFieldTThe field, that is related to the property.
valueTThe value that is to be set to the field in case the PropertyChanging event is not being Cancel.
Returns:true if new value is being set
Increments the suspension count. Property-changing notifications are suppressed until notifications resume.
public virtual bool SuspendNotifications()
true if notifications were not already suspended; otherwise, false.
Events
Occurs when a property of an object changes.
public virtual event PropertyChangedEventHandler PropertyChanged
Implements:
Occurs before a property of an object changes.
public virtual event PropertyChangingEventHandlerEx PropertyChanging
Implements: