Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Can not convert EventColor to type 'Xamarin.Forms.Color'

$
0
0

I'm trying to change TextColorProperty on a TextCell using a DataTemplate. in my model I have public Xamarin.Forms.Color EventColor to use in the datatemplate. For some reason its telling me it can't convert EventColor(Xamarin.Forms.Color) to 'Xamarin.Forms.Color'. They should be the same thing. Why is it confused about using the EventColor from my model?

my EventColor in Classes looks like this:

EventColor = R=1, G=0, B=0, A=1, Hue=1, Saturation=1, Luminosity=0.5

ListView and DataTemplate

classList = new ListView()
            {
                ItemsSource = viewModelStart.Classes,
            };

            classList.ItemTemplate = new DataTemplate(typeof(TextCell));
            classList.ItemTemplate.SetBinding(TextCell.TextProperty, "class_name");
            classList.ItemTemplate.SetBinding(TextCell.DetailProperty, "start_time");
            classList.ItemTemplate.SetValue(TextCell.TextColorProperty, "EventColor");

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>