WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class VisualContainer.VisualCollection

    Show / Hide Table of Contents

    Class VisualContainer.VisualCollection

    A collection of System.Windows.Media.Visual objects. Adding and removing elements through the this collection does not trigger calls to InvalidateMeasure in the parent container.

    Inheritance
    System.Object
    VisualContainer.VisualCollection
    Implements
    System.Collections.Generic.IList<System.Windows.Media.Visual>
    System.Collections.Generic.ICollection<System.Windows.Media.Visual>
    System.Collections.Generic.IEnumerable<System.Windows.Media.Visual>
    System.Collections.IEnumerable
    System.IDisposable
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Windows.Controls.Scroll
    Assembly: Syncfusion.GridCommon.Wpf.dll
    Syntax
    public class VisualCollection : IList<Visual>, ICollection<Visual>, IEnumerable<Visual>, IEnumerable, IDisposable

    Constructors

    VisualCollection(VisualContainer)

    Initializes a new instance of the VisualContainer.VisualCollection class.

    Declaration
    public VisualCollection(VisualContainer owner)
    Parameters
    Type Name Description
    VisualContainer owner

    The owner.

    Properties

    Count

    Gets the number of elements contained in the VisualContainer.VisualCollection.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    IsReadOnly

    Gets a value indicating whether the VisualContainer.VisualCollection is read-only.

    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean

    Item[Int32]

    Gets or sets the System.Windows.Media.Visual at the specified index.

    Declaration
    public Visual this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    System.Windows.Media.Visual

    Methods

    Add(Visual)

    Adds an item to the VisualContainer.VisualCollection.

    Declaration
    public void Add(Visual item)
    Parameters
    Type Name Description
    System.Windows.Media.Visual item

    The object to add to the VisualContainer.VisualCollection.

    Clear()

    Removes all items from the VisualContainer.VisualCollection.

    Declaration
    public void Clear()

    Contains(Visual)

    Determines whether the VisualContainer.VisualCollection contains a specific value.

    Declaration
    public bool Contains(Visual item)
    Parameters
    Type Name Description
    System.Windows.Media.Visual item

    The object to locate in the VisualContainer.VisualCollection.

    Returns
    Type Description
    System.Boolean

    true if item is found in the VisualContainer.VisualCollection; otherwise, false.

    CopyTo(Visual[], Int32)

    Copies the elements of the VisualContainer.VisualCollection to an System.Array, starting at a particular System.Array index.

    Declaration
    public void CopyTo(Visual[] array, int arrayIndex)
    Parameters
    Type Name Description
    System.Windows.Media.Visual[] array

    The one-dimensional System.Array that is the destination of the elements copied from VisualContainer.VisualCollection. The System.Array must have zero-based indexing.

    System.Int32 arrayIndex

    The zero-based index in array at which copying begins.

    Exceptions
    Type Condition
    System.ArgumentNullException

    array is null.

    System.ArgumentOutOfRangeException

    arrayIndex is less than 0.

    System.ArgumentException

    array is multidimensional.-or-arrayIndex is equal to or greater than the length of array.-or-The number of elements in the source VisualContainer.VisualCollection is greater than the available space from arrayIndex to the end of the destination array.-or-Type T cannot be cast automatically to the type of the destination array.

    Dispose()

    Declaration
    public void Dispose()

    GetEnumerator()

    Returns an enumerator that iterates through the collection.

    Declaration
    public IEnumerator<Visual> GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.IEnumerator<System.Windows.Media.Visual>

    A enumerator that can be used to iterate through the collection.

    IndexOf(Visual)

    Determines the index of a specific item in the System.Windows.Media.Visual.

    Declaration
    public int IndexOf(Visual item)
    Parameters
    Type Name Description
    System.Windows.Media.Visual item

    The object to locate in the System.Windows.Media.Visual.

    Returns
    Type Description
    System.Int32

    The index of item if found in the list; otherwise, -1.

    Insert(Int32, Visual)

    Inserts an item to the System.Windows.Media.Visual at the specified index.

    Declaration
    public void Insert(int index, Visual item)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index at which item should be inserted.

    System.Windows.Media.Visual item

    The object to insert into the System.Windows.Media.Visual.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    index is not a valid index in the System.Windows.Media.Visual.

    Remove(Visual)

    Removes the first occurrence of a specific object from the VisualContainer.VisualCollection.

    Declaration
    public bool Remove(Visual item)
    Parameters
    Type Name Description
    System.Windows.Media.Visual item

    The object to remove from the VisualContainer.VisualCollection.

    Returns
    Type Description
    System.Boolean

    true if item was successfully removed from the VisualContainer.VisualCollection; otherwise, false. This method also returns false if item is not found in the original VisualContainer.VisualCollection.

    RemoveAt(Int32)

    Removes the System.Windows.Media.Visual item at the specified index.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the item to remove.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    index is not a valid index in the System.Windows.Media.Visual.

    Explicit Interface Implementations

    IEnumerable.GetEnumerator()

    Declaration
    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    System.IDisposable

    Extension Methods

    FunctionalExtensions.ForEach<T>(IEnumerable, Action<T>)
    FunctionalExtensions.ToList<T>(IEnumerable)
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved