-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] GradientStop binding color isn't working #11898
Comments
I just tried this out with the XF 5.0 release, using XAML along these lines: <Grid.Background>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<GradientStop Color="{Binding Color, Converter={StaticResource ColorConverter}}" Offset="0" />
<GradientStop Color="Transparent" Offset="1.5" />
</LinearGradientBrush>
</Grid.Background> The Color property is a string, and its value is set during the course of execution. The converter runs and returns the correct result of type Color. But the gradient brush renders fully transparent. If I bind to a property of type Color, it works. Any ideas? Thanks. |
The issue seems to lie in finding the binding path. For anyone encountering this issue, try to explicitly set the path and then bind to that by reference like I have here with 'siteOpType'. My StateColor property is of type Xamarin.Forms.Color.
|
I also ran into this bug. The solution was to add the desired color to the dictionary of static resources, and use it through binding
|
Description
Trying to bind a color to GradientStop isn't working as expected
XF Version: 4.8
The text was updated successfully, but these errors were encountered: