ColumnDefinitionCollection class

Applies to Windows and Windows Phone

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

Inheritance

Object
  ColumnDefinitionCollection

Syntax


public ref class ColumnDefinitionCollection sealed : IVector<ColumnDefinition>,
    IIterable<ColumnDefinition>


<Grid ...>
  <Grid.ColumnDefinitions>
    oneOrMoreColumnDefinitions
  </Grid.ColumnDefinitions>
</Grid>

XAML Values

oneOrMoreColumnDefinitions

One or more ColumnDefinition object elements.

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The ColumnDefinitionCollection class has these types of members:

Methods

The ColumnDefinitionCollection class has these methods. It also inherits methods from the Object class.

MethodDescription
Add [C#, VB]Adds a new item to the collection.
Append Adds a new item to the collection.
Clear Removes all items from the collection.
Contains [C#, VB]Determines whether an element is in the collection.
CopyTo [C#, VB]Copies the elements of the collection to an array, starting at a particular array index.
First Returns the iterator for iteration over the items in the collection.
GetAt Returns the ColumnDefinition located at the specified index.
GetMany Retrieves multiple elements in a single pass through the iterator.
GetView Gets an immutable view into the collection.
IndexOf Retrieves the index of the specified item.
IndexOf [C#, VB]Determines the index of a specific item in the collection.
Insert [C#, VB]Inserts an item into the collection at the specified index.
InsertAt Inserts the specified item at the specified index.
Remove [C#, VB]Removes the first occurrence of a specific object from the collection.
RemoveAt Removes the item at the specified index.
RemoveAt [C#, VB]Removes the element at the specified index of the collection.
RemoveAtEnd Removes the last item in the collection.
ReplaceAll Initially clears the collection, then inserts the provided array as new items.
SetAt Sets the value at the specified index to the ColumnDefinition value specified.

 

Properties

The ColumnDefinitionCollection class has these properties.

PropertyAccess typeDescription

Count [C#, VB]

Read-onlyGets the number of elements contained in the collection.

IsReadOnly [C#, VB]

Read-onlyGets a value indicating whether the collection is read-only.

Item [C#, VB]

Read/writeGets or sets the element at the specified index.

Size

Read-onlyGets the size (count) of the collection.

 

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.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

Grid
ColumnDefinition
IVector<T>
IIterable<T>
IList<T>

 

 

Show:
© 2014 Microsoft. All rights reserved.