Skip to content

Instantly share code, notes, and snippets.

@baileysh9
Created July 14, 2017 17:58
Show Gist options
  • Save baileysh9/47345e45d01b3b11de581d1237db70cf to your computer and use it in GitHub Desktop.
Save baileysh9/47345e45d01b3b11de581d1237db70cf to your computer and use it in GitHub Desktop.
public GradientTestPage()
{
InitializeComponent();
Color[] gradientColors = new Color[] { Color.Black, Color.Orange, Color.Black };
GradientModel g = new GradientModel()
{
GradientColors = gradientColors,
ViewWidth = 300,
ViewHeight = 50,
RoundCorners = true,
CornerRadius = 10,
LeftToRight = true
};
gradientView.SetBinding(GradientViewRender.GradientColorsProperty, "GradientColors");
gradientView.SetBinding(GradientViewRender.CornerRadiusProperty, "CornerRadius");
gradientView.SetBinding(GradientViewRender.ViewWidthProperty, "ViewWidth");
gradientView.SetBinding(GradientViewRender.ViewHeightProperty, "ViewHeight");
gradientView.SetBinding(GradientViewRender.RoundCornersProperty, "RoundCorners");
gradientView.SetBinding(GradientViewRender.LeftToRightProperty, "LeftToRight");
gradientView.BindingContext = g;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment