Class ReadOnlyObservableCollection<T>
Represents a read-only wrapper around an ObservableCollection that provides change notifications.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.Data
Assembly: Telerik.WinControls.dll
Syntax
public class ReadOnlyObservableCollection<T> : ReadOnlyCollection<T>, IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged
Type Parameters
T
The type of elements in the collection. |
Remarks
This class provides a read-only view of an observable collection while forwarding all change notifications from the underlying collection. It prevents modification while maintaining observability.
Constructors
ReadOnlyObservableCollection(ObservableCollection<T>)
Initializes a new instance of the ReadOnlyObservableCollection<T> class with the specified observable collection.
Declaration
public ReadOnlyObservableCollection(ObservableCollection<T> list)
Parameters
ObservableCollection<T>
list
The ObservableCollection to wrap as read-only. |
Methods
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Fires the CollectionChanged event when the underlying collection changes.
Declaration
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters
NotifyCollectionChangedEventArgs
args
The event arguments describing the collection change. |
OnPropertyChanged(PropertyChangedEventArgs)
Fires the PropertyChanged event when a property of the underlying collection changes.
Declaration
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
Parameters
System.ComponentModel.PropertyChangedEventArgs
args
The event arguments describing the property change. |
Events
CollectionChanged
Occurs when an item is added, removed, changed, moved, or the entire list is refreshed.
Declaration
protected event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
NotifyCollectionChangedEventHandler
|
PropertyChanged
Occurs when when a property of an object changes change. Calling the event is developer's responsibility.
Declaration
protected event PropertyChangedEventHandler PropertyChanged
Event Type
System.ComponentModel.PropertyChangedEventHandler
|
Explicit Interface Implementations
INotifyCollectionChanged.CollectionChanged
Occurs when an item is added, removed, changed, moved, or the entire list is refreshed.
Declaration
event NotifyCollectionChangedEventHandler INotifyCollectionChanged.CollectionChanged
Returns
NotifyCollectionChangedEventHandler
|