I am trying to bind the text color of a TextView in Android. Here is my (truncated) xaml:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:MvxBind=" TextColor CategoryTextColor(Category)"/>
where CategoryTextColorValueConverter is as follows:
public class CategoryTextColorConverter : MvxValueConverter<ShowCategory, Color>
{
protected override Color Convert (ShowCategory value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == ShowCategory.AllShows)
{
return Color.Blue;
}
return Color.Red;
}
}
The converter is getting called and returns a colour as expected, but the text colour never changes on the TextView. I have a similar binding for the background colour that works fine. I've seen here In MvvmCross how do I do custom bind properties that maybe I need to create a custom binding, but I cannot find MvxBaseAndroidTargetBinding
. Perhaps I need to install a separate package from nuget?