【发布时间】:2018-08-17 09:29:37
【问题描述】:
我在我的 Xamarin 表单项目中使用库“Stormlion.ShapeControl”(GitHub here) 在列表视图项中生成一个圆圈。
列表中的每个项目都需要为圆圈使用不同的填充颜色。
现在我正在使用代码
<shapes:Circle HeightRequest="20" WidthRequest="20">
<shapes:Circle.Paint>
<shapes:SSPaint x:Name="circleFillColor" FillColor="Orange"/>
</shapes:Circle.Paint>
</shapes:Circle>
效果很好,但是当我尝试使用以下代码绑定颜色时:
<shapes:Circle HeightRequest="20" WidthRequest="20">
<shapes:Circle.Paint>
<shapes:SSPaint x:Name="circleFillColor" FillColor="{Binding Path=Color}"/>
</shapes:Circle.Paint>
</shapes:Circle>
我得到错误:
未找到“FillColor”的属性、可绑定属性或事件,或者值和属性之间的类型不匹配。
我也无法从后面的代码访问该属性(我假设它是列表视图的一部分?)
如果有人能指出我正确的方向,那就太好了!
【问题讨论】:
标签: c# xaml xamarin.forms