Class AttachableCollection<T>
Represents a collection of IAttachedObject with a shared AssociatedObject and provides change notifications to its contents when that AssociatedObject changes.
public abstract class AttachableCollection<T> : FreezableCollection<T>, IAnimatable, IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged, IAttachedObject where T : DependencyObject, IAttachedObject
Type Parameters
T
- Inheritance
-
AttachableCollection<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- Derived
- Inherited Members
- Extension Methods
Properties
AssociatedObject
The object on which the collection is hosted.
protected DependencyObject AssociatedObject { get; }
Property Value
Methods
Attach(DependencyObject)
Attaches to the specified object.
public void Attach(DependencyObject dependencyObject)
Parameters
dependencyObject
DependencyObjectThe object to attach to.
Exceptions
- InvalidOperationException
The IAttachedObject is already attached to a different object.
Detach()
Detaches this instance from its associated object.
public void Detach()
OnAttached()
Called immediately after the collection is attached to an AssociatedObject.
protected abstract void OnAttached()
OnDetaching()
Called when the collection is being detached from its AssociatedObject, but before it has actually occurred.
protected abstract void OnDetaching()