2014-12-26 5 views

ответ

1

Да, вы можете использовать HubName.ScrollToSection(HubSectionName);

MSDN: Hub.ScrollToSection method

Minimal Пример

<Hub x:Name="myHub"> 
    <HubSection x:Name="myHubSection"> 
     <DataTemplate> 
      <Grid Width="2000" Height="1000"> 
       <TextBlock Text="hi"></TextBlock> 
       <Button Content="ScrollToNext" VerticalAlignment="Bottom" Click="Button_Click"></Button> 
      </Grid> 
     </DataTemplate> 
    </HubSection> 
    <HubSection x:Name="myHubSection2"> 
     <DataTemplate> 
      <Grid Width="900"> 
       <TextBlock Text="hi2"></TextBlock> 
      </Grid> 
     </DataTemplate> 
    </HubSection>    
</Hub> 

// this will scroll to myHubSection2 
private void Button_Click(object sender, RoutedEventArgs e) 
{ 
    this.myHub.ScrollToSection(this.myHubSection2); 
} 
+0

Существует также способ изменить HubSection медленнее? – prova2

+1

@ prova2 of the course, см. Https://social.msdn.microsoft.com/Forums/windowsapps/en-US/1b667e9e-012c-4688-9711-87230337a621/making-the-windows-8-hub-control-scroll -Лучш-программные-жесты? форум = winappswithcsharp –

Смежные вопросы