BlockCollection BlockCollection BlockCollection Class

Represents a collection of Block elements.

Syntax

Declaration

public sealed class BlockCollectionpublic sealed class BlockCollectionPublic NotInheritable Class BlockCollection

Remarks

Enumerating the collection in C# or Microsoft Visual Basic

You can iterate through a BlockCollection object in C# or Microsoft Visual Basic. In many cases, such as using foreach syntax, the compiler does this casting for you and you won't need to cast to IEnumerable<Block> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast the collection object to IEnumerable<T> with a Block constraint.

Properties summary

Gets the size (count) of the collection.

Methods summary

Adds a new item to the collection.

Removes all items from the collection.

Returns the iterator for iteration over the items in the collection.

Returns the item located at the specified index.

Retrieves multiple elements in a single pass through the iterator.

Gets an immutable view into the collection.

Retrieves the index of the specified item.

Inserts the specified item at the specified index.

Removes the item at the specified index.

Removes the last item in the collection.

Initially clears the collection, then inserts the provided array as new items.

Sets the value at the specified index to the Block value specified.

Properties

  • Size
    Size
    Size
    Size

    Gets the size (count) of the collection.

    public uint Size { get; }public uint Size { get; }Public ReadOnly Property Size As uintpublic uint Size { get; }

    Property Value

    • uint
      uint
      uint

      The count of items in the collection.

Methods

  • Append(Block)
    Append(Block)
    Append(Block)
    Append(Block)

    Adds a new item to the collection.

    public void Append(Block value)public void Append(Block value)Public Function Append(value As Block) As voidpublic void Append(Block value)

    Parameters

  • Clear()
    Clear()
    Clear()
    Clear()

    Removes all items from the collection.

    public void Clear()public void Clear()Public Function Clear() As voidpublic void Clear()
  • First()
    First()
    First()
    First()

    Returns the iterator for iteration over the items in the collection.

    public IIterator<Block> First()public IIterator<Block> First()Public Function First() As IIterator( Of Block )public IIterator<Block> First()

    Returns

    • The iterator object. The iterator's current position is at the 0-index position, or at the collection end if the collection is empty.

  • GetAt(UInt32)
    GetAt(UInt32)
    GetAt(UInt32)
    GetAt(UInt32)

    Returns the item located at the specified index.

    public Block GetAt(UInt32 index)public Block GetAt(UInt32 index)Public Function GetAt(index As UInt32) As Blockpublic Block GetAt(UInt32 index)

    Parameters

    • index
      System.UInt32
      System.UInt32
      System.UInt32

      The integer index for the value to retrieve.

    Returns

  • GetMany(UInt32, Block[])
    GetMany(UInt32, Block[])
    GetMany(UInt32, Block[])
    GetMany(UInt32, Block[])

    Retrieves multiple elements in a single pass through the iterator.

    public uint GetMany(UInt32 startIndex, Block[] items)public uint GetMany(UInt32 startIndex, Block[] items)Public Function GetMany(startIndex As UInt32, items As Block[]) As uintpublic uint GetMany(UInt32 startIndex, Block[] items)

    Parameters

    • startIndex
      System.UInt32
      System.UInt32
      System.UInt32

      The index from which to start retrieval.

    • items
      Windows.UI.Xaml.Documents.Block[]
      Windows.UI.Xaml.Documents.Block[]
      Windows.UI.Xaml.Documents.Block[]

      Provides the destination for the result. Size the initial array size as a "capacity" in order to specify how many results should be retrieved.

    Returns

    • uint
      uint
      uint

      The number of items retrieved.

  • GetView()
    GetView()
    GetView()
    GetView()

    Gets an immutable view into the collection.

    public IVectorView<Block> GetView()public IVectorView<Block> GetView()Public Function GetView() As IVectorView( Of Block )public IVectorView<Block> GetView()

    Returns

    • An object representing the immutable collection view.

  • IndexOf(Block, UInt32)
    IndexOf(Block, UInt32)
    IndexOf(Block, UInt32)
    IndexOf(Block, UInt32)

    Retrieves the index of the specified item.

    public bool IndexOf(Block value, UInt32 index)public bool IndexOf(Block value, UInt32 index)Public Function IndexOf(value As Block, index As UInt32) As boolpublic bool IndexOf(Block value, UInt32 index)

    Parameters

    • value

      The value to find in the collection.

    • index
      System.UInt32
      System.UInt32
      System.UInt32

      The index of the item to find, if found.

    Returns

    • bool
      bool
      bool

      true if an item with the specified value was found; otherwise, false.

  • InsertAt(UInt32, Block)
    InsertAt(UInt32, Block)
    InsertAt(UInt32, Block)
    InsertAt(UInt32, Block)

    Inserts the specified item at the specified index.

    public void InsertAt(UInt32 index, Block value)public void InsertAt(UInt32 index, Block value)Public Function InsertAt(index As UInt32, value As Block) As voidpublic void InsertAt(UInt32 index, Block value)

    Parameters

    • index
      System.UInt32
      System.UInt32
      System.UInt32

      The index at which to set the value.

    • value

      The value to set.

  • RemoveAt(UInt32)
    RemoveAt(UInt32)
    RemoveAt(UInt32)
    RemoveAt(UInt32)

    Removes the item at the specified index.

    public void RemoveAt(UInt32 index)public void RemoveAt(UInt32 index)Public Function RemoveAt(index As UInt32) As voidpublic void RemoveAt(UInt32 index)

    Parameters

    • index
      System.UInt32
      System.UInt32
      System.UInt32

      The index position of the item to remove.

  • RemoveAtEnd()
    RemoveAtEnd()
    RemoveAtEnd()
    RemoveAtEnd()

    Removes the last item in the collection.

    public void RemoveAtEnd()public void RemoveAtEnd()Public Function RemoveAtEnd() As voidpublic void RemoveAtEnd()
  • ReplaceAll(Block[])
    ReplaceAll(Block[])
    ReplaceAll(Block[])
    ReplaceAll(Block[])

    Initially clears the collection, then inserts the provided array as new items.

    public void ReplaceAll(Block[] items)public void ReplaceAll(Block[] items)Public Function ReplaceAll(items As Block[]) As voidpublic void ReplaceAll(Block[] items)

    Parameters

    • items
      Windows.UI.Xaml.Documents.Block[]
      Windows.UI.Xaml.Documents.Block[]
      Windows.UI.Xaml.Documents.Block[]

      The new collection items.

  • SetAt(UInt32, Block)
    SetAt(UInt32, Block)
    SetAt(UInt32, Block)
    SetAt(UInt32, Block)

    Sets the value at the specified index to the Block value specified.

    public void SetAt(UInt32 index, Block value)public void SetAt(UInt32 index, Block value)Public Function SetAt(index As UInt32, value As Block) As voidpublic void SetAt(UInt32 index, Block value)

    Parameters

    • index
      System.UInt32
      System.UInt32
      System.UInt32

      The index at which to set the value.

    • value

      The value to set.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.Documents.dll