ResourceDictionary.First Method

Definition

Returns an iterator for the items in the collection.

public:
 virtual IIterator<IKeyValuePair<Platform::Object ^, Platform::Object ^> ^> ^ First() = IIterable<IKeyValuePair<Platform::Object ^, Platform::Object ^> ^>::First;
IIterator<IKeyValuePair<IInspectable, IInspectable const&>> First();
public IIterator<KeyValuePair<object,object>> First();
function first()
Public Function First () As IIterator(Of KeyValuePair(Of Object, Object))

Returns

IIterator<IKeyValuePair<Object,Object>>

IIterator<KeyValuePair<Object,Object>>

IIterator<IKeyValuePair<Platform::Object,Platform::Object>>

IIterator<IKeyValuePair<IInspectable,IInspectable>>

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#. 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

See also