using System; using Xamarin.Forms.Platform; namespace Xamarin.Forms { [RenderWith(typeof(_BoxViewRenderer))] public class BoxView : View, IElementConfiguration { public static readonly BindableProperty ColorProperty = BindableProperty.Create("Color", typeof(Color), typeof(BoxView), Color.Default); readonly Lazy> _platformConfigurationRegistry; public BoxView() { _platformConfigurationRegistry = new Lazy>(() => new PlatformConfigurationRegistry(this)); } public Color Color { get { return (Color)GetValue(ColorProperty); } set { SetValue(ColorProperty, value); } } public IPlatformElementConfiguration On() where T : IConfigPlatform { return _platformConfigurationRegistry.Value.On(); } [Obsolete("Use OnMeasure")] protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint) { return new SizeRequest(new Size(40, 40)); } } }