Jumping to a HubSection
Hub
exposes a handy SectionHeaders
property that is a collection of Header
objects from each HubSection
. This, in combination with Hub
’s ScrollToSection
method, makes it easy to use Hub
with SemanticZoom
to provide a standard way for the user to jump to any HubSection
. Chapter 10, “Items Controls,” shows an example of using SemanticZoom
.
In this section, we leverage the same property and method to provide a much simpler shortcut mechanism. This works well if each HubSection
’s Header
is a string rather than a UIElement
. If you mark our example Hub
with Name="hub"
, you can use the following data binding trick (see Chapter 18) to fill a ComboBox
with the section names:
<ComboBox Header="Jump ...
Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.