1
votes

I am using the library "Stormlion.ShapeControl" (GitHub here) in my Xamarin forms project to generate a circle in a list view item.

Each item in the list needs a different fillcolor for the circle.

Right now I am using the code

<shapes:Circle HeightRequest="20" WidthRequest="20">
    <shapes:Circle.Paint>
        <shapes:SSPaint x:Name="circleFillColor" FillColor="Orange"/>
    </shapes:Circle.Paint>
</shapes:Circle>

Which works fine, however when I try to Bind a color, using this code:

<shapes:Circle HeightRequest="20" WidthRequest="20">
    <shapes:Circle.Paint>
        <shapes:SSPaint x:Name="circleFillColor" FillColor="{Binding Path=Color}"/>
    </shapes:Circle.Paint>
</shapes:Circle>

I get the error:

No property, bindable property, or event found for 'FillColor', or mismatching type between value and property.

I also can't access the property from code behind (I'm assuming as it's part of a list view?)

If anybody could point me in the right direction, that would be great!

1

1 Answers

2
votes

Inspecting the code of the SSPaint object. it seems FillColor is not a bindable property, so you can't use it like this. You will have to give it a static color.

You could either create your own inheritance to work around this and/or open an issue on the repo requesting this functionality. It seems someone already did for the BorderColor as well: https://github.com/stormlion227/ShapeControl.Forms/issues/1