How can I refer the controls inside the ViewCell
of a ListView
:
<ListView x:Name="classesListView"
ItemsSource="{Binding List}"
HasUnevenRows="True"
HeightRequest="200"
ItemSelected="ListView_OnSelection">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell Height="50">
<StackLayout Orientation="Horizontal">
<Switch x:Name="chooseItem" VerticalOptions="Center"/>
<Label Text="{Binding ClassName}" VerticalOptions="Center"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
How can I refer to the Switch
in the code behind(in the ListView_OnSelection
method)
Thanks
Switch
? – Yehor Hromadskyi