User152984 postedI have a Listview. It contains some controls like Image,Label. When tapping on image I need to perform some action. But i'm unable get the control in Code Behind. I given x:Name to Image control. Please help me.
Here the code.
<ListView ItemsSource="{Binding MedicalLabOrders}" RowHeight = "60" BackgroundColor="LightGray">?
<ListView.ItemTemplate>?
<DataTemplate>?
<ViewCell>?
<StackLayout Orientation="Horizontal">?
<Image x:Name="checkBox" HeightRequest = "20" Source = "check.png" />?
<Label Text="{Binding Name}" HorizontalOptions="StartAndExpand" VerticalOptions="Center"/>?
</StackLayout>?
</ViewCell>?
</DataTemplate>?
</ListView.ItemTemplate>?
</ListView>?
How can I access x:Name="checkBox" in Code Behind.
I used this.checkBox.Source = "uncheck.png"; in Code Behind. But it's throwing an error Page does not contain a defenation for checkbox.