Remarks

A HubSectionCollection is the type of object that you get from the Sections property of a Hub. All the properties that use a HubSectionCollection in the Windows Runtime API are read-only properties, where the property is initialized with zero items when an object is first instantiated. But you can then add, remove or query items in the collection at run time, using the HubSectionCollection properties and methods.

Enumerating the collection in C# or Microsoft Visual Basic

A HubSectionCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable with a HubSection constraint.