private GradientItem MapGradient(Gradient source) => new GradientItem { Id = source.Id, Source = new CssGradientSource { Stylesheet = source.Stylesheet }, Size = (Dimensions)_dimensionsConverter.ConvertFromInvariantString(source.Size) };
private void ReadGradient(IGradientControl view, TypedArray typedArray) { var source = typedArray.GetString(Resource.Styleable.GradientView_gradientSource); if (source != null) { var converter = new CssGradientSourceTypeConverter(); view.GradientSource = (IGradientSource)converter.ConvertFromInvariantString(source); } var size = typedArray.GetString(Resource.Styleable.GradientView_gradientSize); if (size != null) { var converter = new DimensionsTypeConverter(); view.GradientSize = (Dimensions)converter.ConvertFromInvariantString(size); } var repeat = typedArray.GetInt(Resource.Styleable.GradientView_gradientRepeat, 0); view.GradientRepeat = (BackgroundRepeat)repeat; }