DispatcherObservableCollection
The class represents a synchronized collection that can be used in WPF applications.
Inherits: BaseObservableCollection
Implements: ISynchronizedCollection<T>, ISynchronizedCollection, ISynchronizable, ICollection<T>, IEnumerable<T>, IEnumerable, IListEx<T>, IList<T>, ICollectionEx<T>, IList, ICollection
Constructors
public DispatcherObservableCollection(IDispatcher dispatcher, IListEx<TItem> items)
dispatcherObservableCollection = DispatcherObservableCollection(dispatcher, items)
The class represents a synchronized collection that can be used in WPF applications.
Properties
public override int Count { get; }
value = dispatcherObservableCollection.Count
Gets the number of elements in the collection.
public IDispatcher Dispatcher { get; }
value = dispatcherObservableCollection.Dispatcher
The dispatcher used to update the collection.
public bool IsReadOnly { get; }
value = dispatcherObservableCollection.IsReadOnly
Gets a value indicating whether the collection is read-only.
public TItem Item { get; set; }
value = dispatcherObservableCollection.Item
dispatcherObservableCollection.Item = value
Gets the IPoint at the specified index, which merges the X,Y and higher order values into a single point
public IListEx<TItem> Items { get; }
value = dispatcherObservableCollection.Items
The underlying collection.
public Lock SyncRoot { get; }
value = dispatcherObservableCollection.SyncRoot
Gets the synchronization root object.
Methods
public virtual void Add(TItem item)
dispatcherObservableCollection.Add(item)
Adds the specified object to the current object.
- other
- The object to add.
Returns: The result of the addition operation.
public virtual void AddRange(IEnumerable<TItem> items)
dispatcherObservableCollection.AddRange(items)
Adds a range of elements to the collection.
- items
- The range of elements.
public virtual void Clear()
dispatcherObservableCollection.Clear()
Clears all cached assemblies.
public bool Contains(TItem item)
result = dispatcherObservableCollection.Contains(item)
Determines whether the specified value is within the current range.
- value
- The value to test.
Returns: true if the value is within the range; otherwise, false.
public void CopyTo(TItem[] array, int arrayIndex)
dispatcherObservableCollection.CopyTo(array, arrayIndex)
Copies the elements of the collection to an array.
- array
- The destination array.
- index
- The zero-based index in the array at which copying begins.
public Scope EnterScope()
result = dispatcherObservableCollection.EnterScope()
Enters a synchronized scope for thread-safe operations on the collection.
Returns: A Scope that represents the synchronized scope.
public IEnumerator<TItem> GetEnumerator()
result = dispatcherObservableCollection.GetEnumerator()
Returns an enumerator that iterates through the collection.
Returns: An enumerator for the collection.
public int IndexOf(TItem item)
result = dispatcherObservableCollection.IndexOf(item)
Returns the index of the specified item in the collection.
- item
- The item to locate.
Returns: The zero-based index of the item, or -1 if not found.
public void Insert(int index, TItem item)
dispatcherObservableCollection.Insert(index, item)
Inserts an item into the collection at the specified index.
- index
- The zero-based index at which to insert the item.
- item
- The item to insert.
public virtual bool Remove(TItem item)
result = dispatcherObservableCollection.Remove(item)
Remove.
- item
- Type of .
public void RemoveAt(int index)
dispatcherObservableCollection.RemoveAt(index)
Removes a point at the specified index
- index
public override int RemoveRange(int index, int count)
result = dispatcherObservableCollection.RemoveRange(index, count)
Removes a range of elements from the collection.
- index
- Starting index.
- count
- Number of elements to remove.
Returns: Number of elements removed.
public virtual void RemoveRange(IEnumerable<TItem> items)
dispatcherObservableCollection.RemoveRange(items)
Remove range of items.
- items
- Items.
Events
public event Action<IEnumerable<TItem>> AddedRange
dispatcherObservableCollection.AddedRange += handler
Occurs when a range of elements is added.
public event Action AfterUpdate
dispatcherObservableCollection.AfterUpdate += handler
Occurs after the collection is updated.
public event Action BeforeUpdate
dispatcherObservableCollection.BeforeUpdate += handler
Occurs before the collection is updated.
public event Action<IEnumerable<TItem>> RemovedRange
dispatcherObservableCollection.RemovedRange += handler
Occurs when a range of elements is removed.