I'm using Xamarin Forms using an MVVM approach and it works well.
I need a add functionality to an existing ListView to display text when the bound value is a certain value.
Here is the cell that generates the description
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout>
<Label Text="{Binding Description}" x:Name="lblDescription"
Style="{DynamicResource ListItemTextStyle}" />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
Is there any way of basically only displaying the label is the following function is true (this could be in the view model or code behind) for example:
private bool IsDescriptionOk(string description)
{
//Look up description possibly in another lookup list
}
id want to bind the visible to the method like:
Visible="{Binding IsDescriptionOk}"
But as its in the List View, id need to pass in the item index if that makes sense?