1
votes

I have an application that consists of a TabbedPage that holds custom ContentViews.

In the main ContentView I have a custom ListView, that has a ListViewRenderer in Xamarin UWP.

The ListView items have a template:

<DataTemplate x:Key="ListViewItemTemplate">
    <Grid x:Name="grid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <!--  TEXT -->
        <TextBlock Grid.Column="0"
                   Margin="5"
                   VerticalAlignment="Center"
                   Foreground="Black"
                   Text="{Binding ActualText}"
                   TextWrapping="WrapWholeWords" />
        <!--  CC -->
        <my:CustomControl Grid.Column="1"
            ActualCValue="{Binding ActualValue, Mode=TwoWay}" />
        <!--  PICKER  -->
        <ComboBox x:Name="cboxPicker"
                  Grid.Column="2"
                  Width="90"
                  Margin="3"
                  VerticalAlignment="Center"
                  ItemsSource="{StaticResource  dataSource}"
                  SelectedIndex="{Binding ActualValue,
                                          Mode=TwoWay}" />
        <!--  SEP -->
        <Border Grid.Row="1"
                Grid.ColumnSpan="3"
                BorderBrush="Gray"
                BorderThickness="1" />
    </Grid>
</DataTemplate>

Unfortunately, when I try to use swipe, the tabs are not changing.

If I use the built-in Xamarin.Forms ListView with items consisting of an image and text, it works normally.

It might be related to the Button's capturing of the focus (assumption).

What should I change to make my custom ListViewRenderer work with swipe?

1
I think you mean "If I use the built-in Xamarin.Forms ListViewRenderer..." however I do not see ListView at al in your XAML. Might help if you could create a MCVE: stackoverflow.com/help/mcve - jgoldberger - MSFT

1 Answers

0
votes

As I was using a ListViewRenderer, there was no ListView in the XAML code (it is only provided by the renderer).

The problem however was with the ListView configuration I used in my custom renderer.

I had this:

(Control as SemanticZoom)?.ManipulationMode = Windows.UI.Xaml.Input.ManipulationModes.None;

Now I use this, and the swipe works normally:

(Control as SemanticZoom)?.ManipulationMode = Windows.UI.Xaml.Input.ManipulationModes.System;