What is Happening:
- I am passing one boolean value to a converter and performing some action(Changing Drawable).
What I am trying to do:
- How to pass two boolean values to a converter and perform some action.
- Is this possible How ?
- If this is not the right approach by passing two inputs to a single value converter, then how to resolve this
CONVERTER
: CruiseShipIndicatorValueConverter.cs
public class CruiseShipIndicatorValueConverter : MvxValueConverter<bool, int>
{
protected override int Convert(bool value, Type targetType, object parameter, CultureInfo culture)
{
if (value)
{
return Resource.Drawable.up_arrow;
}
else
{
return Resource.Drawable.down_arrow;
}
}
protected override bool ConvertBack(int value, Type targetType, object parameter, CultureInfo culture)
{
return base.ConvertBack(value, targetType, parameter, culture);
}
}
XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:gravity="center"
android:layout_gravity="center"
android:padding="2dp">
<MvxImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="2dp"
android:gravity="center"
android:layout_gravity="center"
local:MvxBind="DrawableId QuesSeriesIndicator(questionState)" />
</LinearLayout>