XAML: Semantic Zoom - Vertical Scroll doesn't work - xaml

I need a vertical scroll in both - ZoomInView and ZoomOutView, but it doesn't work. I have tried to specify a horizontal scroll and it works fine, but I need vertical orientation - does anyone has any ideas? Here is my code:
<SemanticZoom x:Name="semanticZoom" ScrollViewer.ZoomMode="Enabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollMode="Enabled"
Margin="5,48,5,60">
<SemanticZoom.ZoomedOutView>
<ListView ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollMode="Enabled"
ScrollViewer.IsVerticalScrollChainingEnabled="False">
...
</ListView>
</SemanticZoom.ZoomedOutView>
<SemanticZoom.ZoomedInView>
<GridView ItemsSource="{Binding Source={StaticResource Collection}}"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollMode="Enabled"
ScrollViewer.IsVerticalScrollChainingEnabled="False">
...

The height of control inside of the ScrollViewer should larger than the height of the ScrollViewer. If not, the ScrollViewer can not be scrolled. If we do not set the Height of the ListView, the ActualHeight of the ScrollViewer is same to the Height of content. The ScrollableHeight is 0.
You should be able to set a value to the Height property of the SemanticZoom or the ListView.

Related

The ScrollViewer automatically changes its height and does not scroll

In my program, I use ScrollViewer to display elements inside, but the problem is that when the ScrollViewer is filled with content, its height automatically changes and it becomes impossible to scroll since the height is equivalent to the content. I put a ScrollViewer inside a Grid and it automatically stretches to its full height VerticalAlignment="Stretch". I can't pre-limit its height because its height automatically adjusts to its parent to fill all the space. How can I solve this?
<Grid Grid.Column="0" RowSpacing="10">
<Grid.RowDefinitions>
<RowDefinition MaxHeight="35"/>
<RowDefinition MaxHeight="35"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="2">
<ScrollViewer VerticalAlignment="Stretch" VerticalScrollMode="Enabled" VerticalScrollBarVisibility="Visible" HorizontalScrollMode="Disabled">
<ItemsControl x:Name="notesContent" Loaded="NotesContent_Loaded" Margin="0,0,15,0">
<ItemsControl.ItemContainerTransitions>
<TransitionCollection>
<AddDeleteThemeTransition>
</AddDeleteThemeTransition>
</TransitionCollection>
</ItemsControl.ItemContainerTransitions>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</Grid>
</Grid>
The ScrollViewer automatically changes its height and does not scroll
The ScrollViewer parent is Grid, and you have set it's VerticalAlignment proeprty as Stretch, it will vertically fill into grid. And it is by design, you can refer to Grid document.
And if you want to make ScrollViewer scrollable, you need to make the content large than ScrollViewer actual height, and the better way is specific height value for ScrollViewer.

Scrollview inside pivot item doesn't full scroll

Hello I have this Page XAML. The problem its that the text inside each PivotItem doesn't scroll correctly, just scroll a bit but no to the end. Pivot works correctly, you can flip Items Horizontally. How can i achieve the correct behavior on the scrolls?
<StackPanel>
<Pivot>
<PivotItem>
<ScrollViewer VerticalScrollMode="Enabled">
<StackPanel Margin="0,0,12,0">
<TextBlock HorizontalAlignment="Left"
TextWrapping="WrapWholeWords"
Foreground="#5D5B5D"
FontWeight="Light"
TextAlignment="Justify"
Margin="0,0,12,0"
Padding="0,0,4,0"
Text="Change for this a very large text so it can scroll!!! "></TextBlock>
<Button Content="OK"
HorizontalAlignment="Center"
Margin="0,18"
Padding="42,4"></Button>
</StackPanel>
</ScrollViewer>
</PivotItem>
<PivotItem>
<ScrollViewer VerticalScrollMode="Enabled">
<StackPanel Margin="0,0,12,0">
<TextBlock HorizontalAlignment="Left"
TextWrapping="WrapWholeWords"
Foreground="#5D5B5D"
FontWeight="Light"
TextAlignment="Justify"
Margin="0,0,12,0"
Padding="0,0,4,0"
Text="Change for this a very large text so it can scroll!!! "></TextBlock>
<Button Content="OK"
HorizontalAlignment="Center"
Margin="0,18"
Padding="42,4"></Button>
</StackPanel>
</ScrollViewer>
</PivotItem>
</Pivot>
From your code I saw that you use a StackPanel outside of the Pivot control, and you didn't set the orientation property, so by default the StackPanel stacks items vertically from top to bottom in the order they are declared. This will influence the Vertical-scroll-mode ScrollViewer inside of it.
A ScrollViewer works when its content's size bigger than the ScrollViewer's size, when a ScrollViewer is inside of a StackPanel, it has no limit of size, the size will fit the child inside of it, so can't a ScrollViewer work correctly.
In this case, you can change the StackPanel outside of your Pivot to Grid, it will solve the problem, or you can give your ScrollViewers a limit height like <ScrollViewer VerticalScrollMode="Enabled" Height="300">, this can also solve the problem.

GridView Vertical ScrollBar Postion Align to Container

I have a GridView declaration in XAML :
<Grid x:Name="ContainerGrid">
<GridView x:Name="GridView" ItemsSource="{Binding ViewModel}"
VerticalAlignment="Stretch" VerticalContentAlignment="Stretch">
<GridView.ItemTemplate>
<DataTemplate>
<Grid Margin="8" MaxWidth="340">
<!-- removed for clarity -->
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
</Grid>
This GridView will displayed it's items in columns.
The problem is ScrollBar shown in right after column last column in row (1 in screenshot).
I want this ScrollBar align to it's Container ContainerGrid (2 in screenshot).
I set VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" in GridView but result is still the same.
UPDATE : My mistake, it's turn out that I have set HorizontalAlignment="Left" in parent container for Grid ContainerGrid.
And have you tried with HorizontalAlignment="Stretch" ? For me the stretch seems to be on the horizontal axis. Eventually, can you check with the Live Visual Tree (on Visual Studio) if there is any padding around the gridview ?
My mistake, it's turn out that I have set HorizontalAlignment="Left" in parent container for Grid ContainerGrid.

Disable diagonal panning in nested FlipView

My XAML roughly looks as follows.
<FlipView>
<FlipViewItem>
<Grid Height="400" Background="Blue"/>
</FlipViewItem>
<FlipViewItem>
<Grid>
<FlipView x:Name="DigestFlipView" Style="{StaticResource DigestViewStyle}"/>
</Grid>
</FlipViewItem>
</FlipView>
And then in my DigestViewStype I have made it vertical as follows:
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<ItemsStackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
What I want is, when swipe is vertical, only inner FlipView should kick in. Also, when swipe is horizontal, only outer FlipView should kick in.
I get the desired behavior if I replace inner FlipView with a ListView. ListView scrolls for vertical swipes and FlipView for horizontal ones. I have tried playing with templates with no luck. Is there a way to achieve what I need with FlipViews?
A ScrollViewer can scroll horizontally. A ScrollViewer can scroll vertically. And, a ScrollViewer can scroll both horizontally and vertically - you are calling this third case "diagonal" scrolling.
A ScrollViewer has a feature where once it starts scrolling either horizontally or vertically, it will no longer scroll the opposite. It sounds like this is what you want. This feature is called "rails".
https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.scrollviewer.ishorizontalrailenabled.aspx
https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.scrollviewer.isverticalrailenabled.aspx

ScrollViewer ContentScroll is missing

my ScrollViewer doesn't work.
scrolling isn't possible.
<ScrollViewer>
<StackPanel>
<ListView> </ListView>
<Grid> </Grid>
<ListView> </ListView>
</StackPanel>
</ScrollViewer>
i have tried different possibilities with setting of height (for ScrollViewer and StackPanel).
how to scroll the content ?
EDIT: VerticalScrollBarVisibility="Visible" and CanContentScroll="True" already used
jeff
It's probably because you have your scrollviewer inside something like a stackpanel. Try a grid instead.