HubSectionCollection class
TOC
Collapse the table of content
Expand the table of content

HubSectionCollection class

Represents an ordered collection of HubSection objects.

Explore this functionality in more depth as part of our App features, start to finish series:  Hierarchical navigation, start to finish (XAML)

Inheritance

Object
  HubSectionCollection

Syntax


public sealed class HubSectionCollection : IList<HubSection>,
    IEnumerable<HubSection>


<Hub>
  oneOrMoreChildren
</Hub>

XAML Values

oneOrMoreChildren

One or more HubSection object elements.

Members

The HubSectionCollection class has these types of members:

Methods

The HubSectionCollection class has these methods. It also inherits methods from the Object class.

MethodDescription
Add [C#, VB]Adds a new item to the end of the collection.
Append [C++]Adds a new item to the collection.
Clear Removes all items from the collection.
Contains [C#, VB]Determines whether an element is in the collection.
CopyTo [C#, VB]Copies the elements of the collection to an array, starting at a particular array index in the destination array.
First [C++]Returns the iterator for iteration over the items in the collection.
GetAt [C++]Returns the item located at the specified index.
GetMany [C++]Retrieves multiple elements in a single pass through the iterator.
GetView [C++]Gets an immutable view into the collection.
IndexOf [C++]Retrieves the index of the specified item.
IndexOf [C#, VB]Determines the index of a specific item in the collection.
Insert [C#, VB]Inserts an item into the collection at the specified index.
InsertAt [C++]Inserts the specified item at the specified index.
Remove [C#, VB]Removes a specific object from the collection.
RemoveAt [C++]Removes the item at the specified index.
RemoveAt [C#, VB]Removes the element at the specified index of the collection.
RemoveAtEnd [C++]Removes the last item in the collection.
ReplaceAll [C++]Initially clears the collection, then inserts the provided array as new items.
SetAt [C++]Sets the value at the specified index to the item value specified.

 

Properties

The HubSectionCollection class has these properties.

PropertyAccess typeDescription

Count [C#, VB]

Read-only

Gets the number of elements that are contained in the collection.

IsReadOnly [C#, VB]

Read-only

Gets a value indicating whether the collection is read-only.

Item [C#, VB]

Read/write

Gets or sets the element at the specified index.

Size [C++]

Read-only

Gets the size (count) of the collection.

 

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<T> with a HubSection constraint.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1 [Windows Store apps only]

Minimum supported server

Windows Server 2012 R2 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06030000)]
[WebHostHidden()]

See also

Object
Control
Hub
HubSection
HubSectionHeaderClickEventArgs
ISemanticZoomInformation
IVector(HubSection)
IIterable(HubSection)
AppBar
CommandBar
Your first app - Part 3: Navigation, layout, and views
Your first app - Add navigation and views in a C++ Windows Store app (tutorial 3 of 4)
Navigation
Adding app bars (XAML)
XAML Hub control sample
XAML AppBar control sample
XAML Navigation sample
Designers
Navigation design basics for UWP apps
Guidelines for app bars
Bottom app bar
Top app bar

 

 

Show:
© 2016 Microsoft