ResourceDictionary.First Method

Definition

Returns an iterator for the items in the collection.

C#
public IIterator<KeyValuePair<object,object>> First();

Returns

IIterator<KeyValuePair<Object,Object>>

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

Implements

Remarks

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

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also