如何 "navigate" 到具体的枢纽位置 Windows Phone 8.1

How to "navigate" to Specifically hub position Windows Phone 8.1

我有一个有 5 个位置的集线器,我只想放一个按钮,当我单击时,转到特定位置...在 Pivot 控件中我可以使用带索引位置的 SelectedItems 但在这里...我不知道不知道

<Grid x:Name="MainFragment" >
            <Hub  x:Name="hubMain" Header="Você no mundo, o mundo em você!" Margin="1,0,0,0">
                <HubSection x:Name="HubOne" Header="A Faculdade dos Guararapes">
                    <DataTemplate>
                        <Grid>
                            <Border CornerRadius="50" Background="White" Opacity="0.5" >
                            </Border>
                            <Image Source="/Assets/Fg.png" Width="100" HorizontalAlignment="Center" VerticalAlignment="Top"></Image>
                            <TextBlock Text="A Faculdade dos Guararapes tem por finalidade desenvolver processos de formação de nível superior, envolvendo o ensino, a pesquisa e a extensão, a prestação de serviços à comunidade, a investigação e a difusão da cultura, da ciência, da tecnologia e das artes." TextWrapping="Wrap" Foreground="White" FontSize="20" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,125,0,0"  />
                            <Border HorizontalAlignment="Center" VerticalAlignment="Bottom" CornerRadius="50" Width="364" Height="150" Margin="11,0" >
                                <Border.Background>
                                    <ImageBrush  Stretch="Fill" ImageSource="Assets/apresentacao.png"/>
                                </Border.Background>
                            </Border>
                        </Grid>
                    </DataTemplate>
                </HubSection>

.ScrollToSection(HubSectionName) 是关键,我的朋友。如果您同时为 hub 和 hub 部分命名,则单击以下按钮应该适合您。

private void MyBtnClick(object sender, RoutedEventArgs e)
{
    hubMain.ScrollToSection(HubOne);
}

但是,我不建议您那样导航,因为它会破坏 Hub 模板的目的。