How to access the Corner Radius Property In IValueConverter ?

Andrew1993Andrew1993 ✭✭USMember ✭✭

My Custom Renderer for Corner Radius is ...
public class ContentViewRoundedCorners : StackLayout
{
public static readonly BindableProperty CornerRaidusProperty =
BindableProperty.Create<ContentViewRoundedCorners, float>(x => x.CornerRadius, 15);

    public float CornerRadius
    {
        get { return (float)GetValue(CornerRaidusProperty); }
        set { SetValue(CornerRaidusProperty, value); }
    }
}

And My IValue Converter code is ..
public class StripedBackgroundIndexConverter : IValueConverter
{

    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value == null || parameter == null) return Color.White;
        var index = ((ListView)parameter).ItemsSource.Cast<object>().ToList().IndexOf(value);

        var counterlistview = ((ListView)parameter).ItemsSource.Cast<object>().ToList().Count-1;



        // return index  == counterlistview ?  //How to check the corner radius here ...  ;

    }
    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

Now the question is how to access the corner radius in the conditional statement give above in the IValueConverter portion ?

Best Answer

Answers

Sign In or Register to comment.