When I try to insert a BoxView with a GradientBackground this exception is thrown. In the c # code I have inserted the Flag, but it is not enough. How could I solve?
System.TypeLoadException: 'Could not resolve type with token 0100009c from typeref (expected class 'Xamarin.Forms.GradientStop' in assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null')'
XAML code
<BoxView>
<BoxView.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="Gray" Offset="0" />
<GradientStop Color="Transparent" Offset="1.0" />
</LinearGradientBrush>
</BoxView.Background>
</BoxView>
c# code
public MainPage()
{
InitializeComponent();
Device.SetFlags(new[] { "Brush_Experimental" });
}
SetFlags
in your App class, not your Page – Jason