I am setting ListView ItemSource
to a List<T>
where T
is my Model. I am Binding some of the Property of this List<T>
to some Label in XAML. And Now based on a Property, I want to Set Label to some Text.
For Example, if (Property.IsCompleted == true)
, I might want to set a Label in my View Cell in the ListView
to "Done" instead of "True".
I hope this summarizes the problem. I have tried other things and none worked.
This is the Item Appearing Method of My ListView:
private void bookingLV_ItemAppearing(object sender, ItemVisibilityEventArgs e)
{
BookingsModel convert = (BookingsModel)e.Item;
var select = convert.IsCompleted;
if(select == true)
{
IsDone = "Completed";
}
IsDone = "Pending";
}
And I have a Custom Property called IsDone:
public string IsDone { get; set; }
And This is how I am Binding IsDone in the View Cell of the ListView in Xaml
<Label Text="{Binding IsDone}"></Label>
I want to be able to set the Text Property of my Label to some text based on a property of my Model Object.