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

Definition

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)

Returns

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.

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.

See also