/ / Lier uniquement le décalage vertical de deux visionneuses de défilement - winrt-xaml, windows-8.1, scrollviewer

Liaison uniquement du décalage vertical de deux scrollviewers - winrt-xaml, windows-8.1, scrollviewer

J'ai un scrollview avec une grande grille contenantdeux grilles plus petites. les grilles sont supposées défiler ensemble verticalement, mais seule la grille de droite doit défiler horizontalement. Cela est dû au fait que les informations dans la grille de gauche sont nécessaires comme référence, tandis que la grille de droite peut contenir plus de 100 colonnes.

J'ai déjà essayé de placer les grilles dans des vues de défilement séparées et de les lier avec un gestionnaire d'événements. Mais je n’ai trouvé aucun code pour le faire dans une application Windows 8.1.

Est-il possible de faire cela pour les applications WinRT?

2 grilles en 1 scrollview

Réponses:

1 pour la réponse № 1

Vous devriez imbriquer le ScrollViewers. Quelque chose comme ça:

<Grid
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<ScrollViewer>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="Auto"/>
<ColumnDefinition
Width="700"/>
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">1</TextBlock>
</StackPanel>
<ScrollViewer
Grid.Column="1"
VerticalScrollBarVisibility="Disabled"
VerticalScrollMode="Disabled"
HorizontalScrollBarVisibility="Auto"
HorizontalScrollMode="Auto"
ZoomMode="Disabled">
<StackPanel>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
<TextBlock Margin="10,10,50,10" FontSize="24">A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. A very long text. </TextBlock>
</StackPanel>
</ScrollViewer>
</Grid>
</ScrollViewer>
</Grid>