2014-10-16 66 views
2

我有一个Windows 8.1视图: 例如:如何以编程方式在Windows 8.1中滚动视图?

MyPage.xaml

<Grid> 
<Hub> 
<HubSection x:Name"FirstSection"> 
<Button x:Name="NavigateToThirdSection" Tapped="NavigateToThirdSection_Tapped"></Button> 
</HubSection> 
<HubSection x:Name"SecondSection"> 
</HubSection> 
<HubSection x:Name"ThirdSection"> 
<TextBlock Text="Third Section.."></TextBlock> 
</HubSection> 
</Hub> 
</Grid> 

MyPage.xaml.cs

private void StackPanel_Tapped(object sender, TappedRoutedEventArgs e) 
{ 
//What Should I do to reach the third HubSection end of the page when I click the button at the first HubSection 
} 

我需要水平时到达页面的结尾我点击页面开始处的按钮。

问候,

+1

想我得到了答案后:Hub.ScrollToSection(HubSection); – 2014-10-16 14:21:22

回答

1

首先,给Hubname MainHub或等..

private void StackPanel_Tapped(object sender, TappedRoutedEventArgs e) 
{ 
    //What Should I do to reach the third HubSection end of the page when I click the button at the first HubSection 
    MainHub.ScrollToSection(ThirdSection); 
} 
相关问题