I have a ListView in which it contains several Switch controls, I have placed a BindingContext, but when doing Tap on the Switch at run time, it changes to true in all the rows of the list and what I need is that it only changes in the selected row.
This is my XAML code
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.Views.CalificarPage"
xmlns:local="clr-namespace:MyApp.Models"
xmlns:viewModels="clr-namespace:MyApp.ViewModels"
BindingContext="{Binding Main, Source={StaticResource Locator}}"
BackgroundColor="White"
Style="{DynamicResource NavigationPage}">
<ContentPage.Resources>
<ResourceDictionary>
<local:StringToBoolConverter x:Key="stringToBool" />
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout BindingContext="{Binding Calificar}"
x:Name="Calificar">
<StackLayout.Padding>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="Android" Value="0,0,0,0" />
<On Platform="iOS" Value="0,0,0,0" />
</OnPlatform>
</StackLayout.Padding>
<ListView
ItemsSource="{Binding MiLista}"
HasUnevenRows="True">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Grid BackgroundColor="White">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackLayout Grid.Row="0" Grid.ColumnSpan="4">
<Grid>
<BoxView
BackgroundColor="#132F52">
</BoxView>
<Label
FontAttributes="Bold"
HorizontalOptions="StartAndExpand"
Margin="5,0,0,0"
Text="{Binding Usuario}"
TextColor="White"
VerticalOptions="CenterAndExpand">
</Label>
</Grid>
</StackLayout>
<StackLayout Grid.Row="1" Grid.ColumnSpan="4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="0">
<Switch
IsToggled="{Binding Path=BindingContext.Lunes, Source={x:Reference Name=Calificar}, Mode=TwoWay}"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand">
</Switch>
</StackLayout>
<StackLayout Grid.Column="1">
<Switch
IsToggled="{Binding Path=BindingContext.Martes, Source={x:Reference Name=Calificar}, Mode=TwoWay}"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand">
</Switch>
</StackLayout>
<StackLayout Grid.Column="2">
<Switch
IsToggled="{Binding Path=BindingContext.Miercoles, Source={x:Reference Name=Calificar}, Mode=TwoWay}"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand">
</Switch>
</StackLayout>
<StackLayout Grid.Column="3">
<Switch
IsToggled="{Binding Path=BindingContext.Jueves, Source={x:Reference Name=Calificar}, Mode=TwoWay}"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand">
</Switch>
</StackLayout>
</Grid>
</StackLayout>
</Grid>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<StackLayout>
<Button
Style="{StaticResource FollowButton}"
Command="{Binding EnviarCommand}"
Margin="40,20,40,20"
BorderRadius="25"
HeightRequest="50"
Text="ENVIAR"
TextColor="White"
VerticalOptions="CenterAndExpand"
BackgroundColor="#132F52">
</Button>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>