This documentation is archived and is not being maintained.
VisualCollection Class
Visual Studio 2010
Represents an ordered collection of Visual objects.
Assembly: PresentationCore (in PresentationCore.dll)
The VisualCollection type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Capacity | Gets or sets the number of elements that the VisualCollection can contain. |
![]() | Count | Gets the number of elements in the collection. |
![]() | IsReadOnly | Gets a value that indicates whether the VisualCollection is read-only. |
![]() | IsSynchronized | Gets a value that indicates whether access to the VisualCollection is synchronized (thread-safe). |
![]() | Item | Gets or sets the Visual that is stored at the zero-based index of the VisualCollection. |
![]() | SyncRoot | Gets an object that can be used to synchronize access to the VisualCollection. |
| Name | Description | |
|---|---|---|
![]() | Add | Appends a Visual to the end of the VisualCollection. |
![]() | Clear | Removes all elements from the VisualCollection. |
![]() | Contains | Returns a Boolean value that indicates whether the specified Visual is contained in the collection. |
![]() | CopyTo(Array, Int32) | Copies the items in the collection to an array, starting at a specific array index. |
![]() | CopyTo(array<Visual>, Int32) | Copies the current collection into the passed Visual array. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetEnumerator | Retrieves an enumerator that can iterate through the VisualCollection. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IndexOf | Returns the zero-based index of the Visual. |
![]() | Insert | Inserts an element into the VisualCollection at the specified index. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Remove | Removes the specified Visual object from the VisualCollection. |
![]() | RemoveAt | Removes the visual object at the specified index in the VisualCollection. |
![]() | RemoveRange | Removes a range of visual objects from the VisualCollection. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | AsParallel | Enables parallelization of a query. (Defined by ParallelEnumerable.) |
![]() | AsQueryable | Converts an IEnumerable to an IQueryable. (Defined by Queryable.) |
![]() | Cast<TResult> | Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
![]() | OfType<TResult> | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IEnumerable::GetEnumerator | This member supports the WPF infrastructure and is not intended to be used directly from your code. For a description of this member, see GetEnumerator. |
A VisualCollection has implied context affinity. If a procedure attempts to access the VisualCollection from a different context than the context of the owning ContainerVisual, an exception is thrown.
The following example shows how to create a VisualCollection and add members to it.
Note |
|---|
For the complete sample, see Hit Test Using DrawingVisuals Sample. |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show:
