public static Sdk.Style.Layers.BackgroundLayer ToNative(this BackgroundLayer background) { if (background == null) { return(null); } var native = new Sdk.Style.Layers.BackgroundLayer(background.Id); native.SetProperties ( Sdk.Style.Layers.PropertyFactory.BackgroundColor(background.BackgroundColor.ToAndroid()) ); return(native); }
public static BackgroundLayer ToForms(this Sdk.Style.Layers.BackgroundLayer background) { if (background == null) { return(null); } BackgroundLayer forms = new BackgroundLayer(background.Id, ""); if (background.BackgroundColor.IsNull && background.BackgroundColor.ColorInt != null) { Android.Graphics.Color backgroundColor = new Android.Graphics.Color((int)background.BackgroundColor.ColorInt); forms.BackgroundColor = Xamarin.Forms.Color.FromRgb(backgroundColor.R, backgroundColor.G, backgroundColor.B); } return(forms); }