diff --git a/README.md b/README.md index 5ba2c91..85be3c5 100644 --- a/README.md +++ b/README.md @@ -1 +1,49 @@ **[View document in Syncfusion .NET MAUI Knowledge Base](https://www.syncfusion.com/kb/13090/how-to-apply-the-item-text-color-in-net-maui-listview-sflistview)** + +## Sample + +```xaml + + + + + + + + + + + . . . + . . . + + + + + +C#: + +public class ColorConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null) + return false; + var itemdata = value as Contacts; + if (itemdata.ContactType == "HOME") + return Colors.RoyalBlue; + else if (itemdata.ContactType == "WORK") + return Colors.PaleGreen; + else if (itemdata.ContactType == "MOBILE") + return Colors.HotPink; + else if (itemdata.ContactType == "OTHER") + return Colors.DarkGoldenrod; + else + return Colors.BlueViolet; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} +``` \ No newline at end of file