I'm trying this in collection view and i want each item with a different color so I have bound color to GradientStop
in xaml like this:
<BoxView.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Color="{Binding gradient_start_color}" Offset="0.1" />
<GradientStop Color="{Binding gradient_stop_color}" Offset="1.0" />
</LinearGradientBrush>
</BoxView.Background>
But the color is not bound and by default i get transparent background. Is there a way to bind gradientstop
color?
This is a known bug in Xamarin.Forms https://github.com/xamarin/Xamarin.Forms/issues/12339, the workaround mentioned there is to change it in the code-behind rather than using data binding in xaml.