Hi everybody,
I need to change a label text put into a Viewcell from codebehind but I receive an error dispayng "the name likecount does not exist in the current context".
I want to show the label value initially(like count), it is working.
<ListView x:Name="ListView1" RowHeight="500">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label
Text="{Binding likeCount}"
x:Name="likecount"
Font="14"
TextColor="Black"
HorizontalOptions="Start"
VerticalOptions="Center"/>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
After like or unlike i want to change the label text(like count). For that i use the following code:
If(like){
likecount.Text = item.likeCount + 1;
} else{
likecount.Text = item.likeCount - 1;
}
Currently showing, The name likecount does not exist in the current context.
Can you show how you create the datamodel?
Please help me, Thanks in advance.