DependencyObjectCollection.First Method

Definition

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

public:
 virtual IIterator<DependencyObject ^> ^ First() = IIterable<DependencyObject ^>::First;
IIterator<DependencyObject> First();
public IIterator<DependencyObject> First();
Public Function First () As IIterator(Of DependencyObject)

Returns

Windows.Foundation.Collections.IIterator<DependencyObject>

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

Implements

Windows.Foundation.Collections.IIterable`1.First

Remarks

You can iterate through a DependencyObjectCollection 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<DependencyObject> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable with a DependencyObject constraint.

Applies to