ResourceDictionary.First ResourceDictionary.First ResourceDictionary.First ResourceDictionary.First Method


Returns an iterator for the items in the collection.

public : IIterator<IKeyValuePair<Platform::Object, Platform::Object>> First()
IIterator<IKeyValuePair<winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable>> First() const;
public IIterator<KeyValuePair<object, object>> First()
Public Function First() As IIterator<KeyValuePair<object, object>>(Of IKeyValuePair)


IIterator<KeyValuePair<object, object>> 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.


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.

See also