ColumnDefinitionCollection ColumnDefinitionCollection ColumnDefinitionCollection Class

Definition

Provides access to an ordered, strongly typed collection of ColumnDefinition objects.

public sealed class ColumnDefinitionCollectionpublic sealed class ColumnDefinitionCollectionPublic NotInheritable Class ColumnDefinitionCollection
<Grid ...>
  <Grid.ColumnDefinitions>
    oneOrMoreColumnDefinitions
  </Grid.ColumnDefinitions>
</Grid>
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Enumerating the collection in C# or Microsoft Visual Basic

A ColumnDefinitionCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable<ColumnDefinition> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable<T> with a ColumnDefinition constraint.

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; }
Value
uint uint uint

The count of items in the collection.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

Append(ColumnDefinition) Append(ColumnDefinition) Append(ColumnDefinition) Append(ColumnDefinition)

Adds a new item to the collection.

public void Append(ColumnDefinition value)public void Append(ColumnDefinition value)Public Function Append(value As ColumnDefinition) As voidpublic void Append(ColumnDefinition value)
Parameters
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Clear() Clear() Clear() Clear()

Removes all items from the collection.

public void Clear()public void Clear()Public Function Clear() As voidpublic void Clear()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

First() First() First() First()

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

public IIterator<ColumnDefinition> First()public IIterator<ColumnDefinition> First()Public Function First() As IIterator( Of ColumnDefinition )public IIterator<ColumnDefinition> 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.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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

Returns the ColumnDefinition located at the specified index.

public ColumnDefinition GetAt(UInt32 index)public ColumnDefinition GetAt(UInt32 index)Public Function GetAt(index As UInt32) As ColumnDefinitionpublic ColumnDefinition GetAt(UInt32 index)
Parameters
index
System.UInt32 System.UInt32 System.UInt32

The integer index for the value to retrieve.

Returns
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

GetMany(UInt32, ColumnDefinition[]) GetMany(UInt32, ColumnDefinition[]) GetMany(UInt32, ColumnDefinition[]) GetMany(UInt32, ColumnDefinition[])

Retrieves multiple elements in a single pass through the iterator.

public uint GetMany(UInt32 startIndex, ColumnDefinition[] items)public uint GetMany(UInt32 startIndex, ColumnDefinition[] items)Public Function GetMany(startIndex As UInt32, items As ColumnDefinition[]) As uintpublic uint GetMany(UInt32 startIndex, ColumnDefinition[] items)
Parameters
startIndex
System.UInt32 System.UInt32 System.UInt32

The index from which to start retrieval.

items
Windows.UI.Xaml.Controls.ColumnDefinition[] Windows.UI.Xaml.Controls.ColumnDefinition[] Windows.UI.Xaml.Controls.ColumnDefinition[]

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.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

GetView() GetView() GetView() GetView()

Gets an immutable view into the collection.

public IVectorView<ColumnDefinition> GetView()public IVectorView<ColumnDefinition> GetView()Public Function GetView() As IVectorView( Of ColumnDefinition )public IVectorView<ColumnDefinition> GetView()
Returns

An object representing the immutable collection view.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

IndexOf(ColumnDefinition, UInt32) IndexOf(ColumnDefinition, UInt32) IndexOf(ColumnDefinition, UInt32) IndexOf(ColumnDefinition, UInt32)

Retrieves the index of the specified item.

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

The item to find in the collection.

index
System.UInt32 System.UInt32 System.UInt32

The index of the item, if it is found.

Returns
bool bool bool

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

InsertAt(UInt32, ColumnDefinition) InsertAt(UInt32, ColumnDefinition) InsertAt(UInt32, ColumnDefinition) InsertAt(UInt32, ColumnDefinition)

Inserts the specified item at the specified index.

public void InsertAt(UInt32 index, ColumnDefinition value)public void InsertAt(UInt32 index, ColumnDefinition value)Public Function InsertAt(index As UInt32, value As ColumnDefinition) As voidpublic void InsertAt(UInt32 index, ColumnDefinition value)
Parameters
index
System.UInt32 System.UInt32 System.UInt32

The index at which to set the value.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

RemoveAtEnd() RemoveAtEnd() RemoveAtEnd() RemoveAtEnd()

Removes the last item in the collection.

public void RemoveAtEnd()public void RemoveAtEnd()Public Function RemoveAtEnd() As voidpublic void RemoveAtEnd()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

ReplaceAll(ColumnDefinition[]) ReplaceAll(ColumnDefinition[]) ReplaceAll(ColumnDefinition[]) ReplaceAll(ColumnDefinition[])

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

public void ReplaceAll(ColumnDefinition[] items)public void ReplaceAll(ColumnDefinition[] items)Public Function ReplaceAll(items As ColumnDefinition[]) As voidpublic void ReplaceAll(ColumnDefinition[] items)
Parameters
items
Windows.UI.Xaml.Controls.ColumnDefinition[] Windows.UI.Xaml.Controls.ColumnDefinition[] Windows.UI.Xaml.Controls.ColumnDefinition[]

The new collection items.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

SetAt(UInt32, ColumnDefinition) SetAt(UInt32, ColumnDefinition) SetAt(UInt32, ColumnDefinition) SetAt(UInt32, ColumnDefinition)

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

public void SetAt(UInt32 index, ColumnDefinition value)public void SetAt(UInt32 index, ColumnDefinition value)Public Function SetAt(index As UInt32, value As ColumnDefinition) As voidpublic void SetAt(UInt32 index, ColumnDefinition value)
Parameters
index
System.UInt32 System.UInt32 System.UInt32

The index at which to set the value.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)