Updating to XF 4.8 from 4.7 the DynamicResource fill color binding on the Polygon shape is no longer recognized. It still works with a fixed color.
The DynamicResource color binding is used to fill the Polygon.
The Polygon is not drawn at all.
4.7:
4.8:
@StephaneDelcroix or @jsuarezruiz ?
The type supported by the Shapes Fill
and Stroke
properties in Xamarin.Forms 4.8 is a Brush (SolidColorBrush, LinearGradientBrush, or RadialGradientBrush) instead of a Color.
The first case works because there is a TypeConverter
, but in the second, using a Color type, it is not working. Changing the Color resource by a SolidColorBrush fixes the problem.
@jsuarezruiz so you'd like TypeConverters to be applied with DynamicResource, or any kind of Binding too ?
I define a SolidColorBrush entry in my App.xaml and reference this Brush in my Polygon Fill
instead of the Color. But then setting the Color for my SolidColorBrush has the same problem as setting the Color directly.
I can only use a fixed color or StaticResource Color, as soon as I change the Brush Color to a DynamicResource Color it doesn't render the Polygon.
Could you take a look to this modified sample:
PolygonDynamicColor.zip
?
I took a look, but what if I wanted to do it like how it is in this modified modified sample:
PolygonDynamicColor.zip
@bdgza Thanks for the new modified sample. Now I see the issue!. Will answer here when I have the fix.
I think this needs reopened @rmarinho. I've posted a comment on #12836 describing more but if the color dynamically changes the polygon shape does not change color. It is behaving like a StaticResource instead of a DynamicResource.
@BurkusCat Thanks for the feedback, I will review the issue changing the DynamicResource
.
Most helpful comment
@bdgza Thanks for the new modified sample. Now I see the issue!. Will answer here when I have the fix.