0
votes

I have a ListView in PivotItem and my pivot contains 3 pivot items. Each Piovt Item contain ListView. I want to disable scrolling on all the ListViews while user changing the Pivot Item swiping left/right. Currently while swiping left/right the pivot item is in changing mode and also my ListView scrolls. I have tried ManipulationStarted and ManipulationCompleted events but it is not working? Is there a way to achieve this? What I want is the same behavior of WP 8.1 email app, while swiping left/right it disables listview view scrolling.

<Pivot Grid.Row="1">
            <PivotItem Margin="0" >
                <PivotItem.Header>
                    <TextBlock Text="web" />
                </PivotItem.Header>
                    <Grid >

                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Margin="19,0,19,15"
                       Style="{StaticResource PhoneAccentTextSmallStyle}"
                       Visibility="{Binding CountryFacetCurrentlyShowing,Converter={StaticResource empltyStringToVisibilityConverter}}" 
                       Text="{Binding CountryFacetCurrentlyShowing}"></TextBlock>


                    <!-- Search List Items -->
                    <ListView Grid.Row="2" x:Name="grdSearchResults" Width="{Binding ElementName=searchView,Path=ActualWidth}" ItemsSource="{Binding SearchedMembers}"  
                      Visibility="{Binding ElementName=btnGridView,Path=IsEnabled,Converter={StaticResource boolToVisibiliytConverter}}"
                      LayoutUpdated="grdSearchResults_LayoutUpdated"

                    SelectedItem="{Binding SelectedMember,Mode=TwoWay}"
                      SelectionMode="{Binding ListViewMode}"
                              ItemTemplate="{Binding ItemTemplate}"
                      ItemContainerStyle="{StaticResource ListViewItemStyle99}">            



                    </ListView>

                    <!-- Search Grid Items -->
                    <GridView Grid.Row="2" x:Name="grdSearchResults1" Width="{Binding ElementName=searchView,Path=ActualWidth}" ItemsSource="{Binding SearchedMembers}"
                      Visibility="{Binding ElementName=btnListView,Path=IsEnabled,Converter={StaticResource boolToVisibiliytConverter}}"
                              Margin="13,0,13,0" SelectedItem="{Binding SelectedMember,Mode=TwoWay}"
                      LayoutUpdated="grdSearchResults_LayoutUpdated"
                      SelectionMode="{Binding ListViewMode}"
                      ItemContainerStyle="{StaticResource GridViewItemStyle99}"
                              ItemTemplate="{StaticResource SearchGridItemDataTemplate}">


                        <!--<GridView.ItemContainerStyle>
                    <Style TargetType="GridViewItem">
                        <Setter Property="HorizontalContentAlignment" Value="{Binding DataContext.ItemWidth, Mode=OneWay, ElementName=searchView}"></Setter>

                    </Style>
                </GridView.ItemContainerStyle>-->
                    </GridView>
                    <TextBlock Margin="19,10" Text="No matches found." FontSize="16" x:Name="lblNoConten" Foreground="DarkGray" Visibility="{Binding NoContentVisibility}"></TextBlock>
                </Grid>

            </PivotItem>
            <PivotItem Margin="0">
                <PivotItem.Header>
                <TextBlock Text="local" />
                </PivotItem.Header>
            </PivotItem>

        </Pivot>
1
I was trying to reproduce your problem, but I couldn't. For me, the ListView already works just as you wish. You can't scroll it when you change Pivot page. I have recorded it: youtu.be/dq3OWsKBqp8Łukasz Rejman
Thanks @ŁukaszRejman I can't see your video. But to reproduce it press on ListView swipe to right/left but not release your fingure/mouse than move your fingre up/down the listview will scroll. PS I am working on universal app.Muhammad Saifullah
This is what I did. Check out the video. There is no way to scroll the ListView when you swipe Pivot.Łukasz Rejman
can't watch your video. it loading always :(Muhammad Saifullah
What about GIF? :D makeagif.com/i/yXpl4j As you can see, I was trying to scroll the ListView, but I couldn't.Łukasz Rejman

1 Answers

0
votes

Fixed this problem. I was using a default ListView style(which contains nothing new) in my resources and that was causing the problem after removing default style from my resources it works :). Do not know why it was causing the issue.