void SetGradient() { var xfButton = Element as Button; var colorTop = xfButton.BackgroundColor; var colorBottom = ButtonGradientEffect.GetGradientColor(xfButton); Control.SetBackground(Gradient.GetGradientDrawable(colorTop.ToAndroid(), colorBottom.ToAndroid())); }
void SetGradient() { Button xfButton = Element as Button; Color colorTop = ButtonGradientEffect.GetBackgroundColor(xfButton); Color colorBottom = ButtonGradientEffect.GetGradientColor(xfButton); var gd = Gradient.GetGradientDrawable(colorTop.ToAndroid(), colorBottom.ToAndroid()); Control.SetBackground(gd); }
private void SetGradient() { var button = (Button)this.Element; var buttonColorTop = button.BackgroundColor; var buttonColorBottom = ButtonGradientEffect.GetGradientColor(button); this.Control.SetBackground(Gradient.GetGradientDrawable(buttonColorTop.ToAndroid(), buttonColorBottom.ToAndroid())); var colorBottom = ButtonGradientEffect.GetGradientColor(button); }
void SetGradient() { var xfButton = Element as Button; var button = Control as FormsButton; var colorTop = xfButton.BackgroundColor; var colorBottom = ButtonGradientEffect.GetGradientColor(xfButton); button.BackgroundColor = Gradient.GetGradientBrush(GetWindowsColor(colorTop), GetWindowsColor(colorBottom)); }
void setGradient() { var xfButton = Element as Xamarin.Forms.Button; var colorTop = xfButton.BackgroundColor; var colorBottom = ButtonGradientEffect.GetGradientColor(xfButton); var gradient = Gradient.GetGradientDrawable(colorTop.ToAndroid(), colorBottom.ToAndroid()); Control.SetBackground(gradient); }
void SetGradient() { gradLayer?.RemoveFromSuperLayer(); var xfButton = Element as Button; var colorTop = xfButton.BackgroundColor; var colorBottom = ButtonGradientEffect.GetGradientColor(xfButton); gradLayer = Gradient.GetGradientLayer(colorTop.ToCGColor(), colorBottom.ToCGColor(), (float)xfButton.Width, (float)xfButton.Height); Control.Layer.InsertSublayer(gradLayer, 0); }
private void SetGradient() { this.gradLayer?.RemoveFromSuperLayer(); var button = (Button)this.Element; var buttonColorTop = button.BackgroundColor; var buttonColorBottom = ButtonGradientEffect.GetGradientColor(button); this.gradLayer = Gradient.GetGradientLayer(buttonColorTop.ToCGColor(), buttonColorBottom.ToCGColor(), (float)button.Width, (float)button.Height); this.Control.Layer.InsertSublayer(this.gradLayer, 0); }
void SetGradient() { gradLayer?.RemoveFromSuperLayer(); Button xfButton = Element as Button; Color colorTop = ButtonGradientEffect.GetBackgroundColor(xfButton); Color colorBottom = ButtonGradientEffect.GetGradientColor(xfButton); var width = (float)xfButton.Width; var height = (float)xfButton.Height; var gd = Gradient.GetGradientLayer(colorTop.ToCGColor(), colorBottom.ToCGColor(), width, height); Control.Layer.InsertSublayer(gd, 0); }
private void CreateGradient() { gradientLayer?.RemoveFromSuperLayer(); var button = Element as Button; var uiButton = Control as UIButton; if (uiButton.Frame.Width == 0 || uiButton.Frame.Height == 0) { return; } var topColor = button.BackgroundColor; var bottomColor = ButtonGradientEffect.GetGradientColor(button); gradientLayer = Gradient.GetGradientLayer(topColor.ToCGColor(), bottomColor.ToCGColor(), uiButton.Frame.Width, uiButton.Frame.Height); Control.Layer.InsertSublayer(gradientLayer, 0); }