0

I'm working on a universal (XAML, not silverlight) WP8.1 application.

Tapping on a list item automatically shifts the full item into view. Say your list item is not completely showing, because some of it is scrolled off screen. Tapping on it (focus on list item) will scroll the item into view. See below for a video.

I’d like to disable this. I think this is the right property to set to False, but just a guess. Setting this to false doesn't seem to affect anything.

Ideas?

<ListView ScrollViewer.BringIntoViewOnFocusChange="false" ...

http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.scrollviewer.bringintoviewonfocuschange

Here is a repro project https://www.dropbox.com/s/cx4o10zwybgfdzq/JumpListProject.zip?dl=0

Zoe
  • 27,060
  • 21
  • 118
  • 148
Quincy
  • 1,710
  • 14
  • 20

2 Answers2

2

set

IsItemClickEnabled = "True"

BringIntoViewOnFocusChanged does not need to be used. Still a mystery on what that property is used for.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Quincy
  • 1,710
  • 14
  • 20
  • 1
    Hello, would you please help answer this question? http://stackoverflow.com/questions/29841841/calculate-horizontal-offset-to-scroll-listview-to-the-center-of-the-selecteditem – Owehbeh Apr 27 '15 at 09:00
0

Based on the default template of a ListView - the property value should be forwarded to the ScrollViewer with a TemplateBinding. Did you modify your template by any chance?

<Style x:Key="DefaultListViewStyle" TargetType="ListView">
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="TabNavigation" Value="Once"/>
    <Setter Property="IsSwipeEnabled" Value="True"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"/>
    <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto"/>
    <Setter Property="ScrollViewer.ZoomMode" Value="Disabled"/>
    <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
    <Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True"/>
    <Setter Property="ItemContainerTransitions">
        <Setter.Value>
            <TransitionCollection>
                <AddDeleteThemeTransition/>
                <ReorderThemeTransition/>
            </TransitionCollection>
        </Setter.Value>
    </Setter>
    <Setter Property="ItemsPanel">
        <Setter.Value>
            <ItemsPanelTemplate>
                <ItemsStackPanel Orientation="Vertical"/>
            </ItemsPanelTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="ListView">
                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                    <ScrollViewer x:Name="ScrollViewer" AutomationProperties.AccessibilityView="Raw" BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}" IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" TabNavigation="{TemplateBinding TabNavigation}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}">
                        <ItemsPresenter FooterTransitions="{TemplateBinding FooterTransitions}" FooterTemplate="{TemplateBinding FooterTemplate}" Footer="{TemplateBinding Footer}" HeaderTemplate="{TemplateBinding HeaderTemplate}" Header="{TemplateBinding Header}" HeaderTransitions="{TemplateBinding HeaderTransitions}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </ScrollViewer>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
Filip Skakun
  • 31,624
  • 6
  • 74
  • 100
  • Nope I didn't modify it. I also have set it in code and verified that in code that variable is set properly. Are you able to reproduce the UX behavior I am talking about? – Quincy Nov 08 '14 at 18:34
  • Can you share a small repro project? – Filip Skakun Nov 09 '14 at 04:12