summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8/BoxViewRenderer.cs
blob: 846509962c5ea5ae5ebf0538ee0e50ae11fde158 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
´╗┐using System.Windows.Shapes;

namespace Xamarin.Forms.Platform.WinPhone
{
	public class BoxViewRenderer : ViewRenderer<BoxView, System.Windows.Shapes.Rectangle>
	{
		protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e)
		{
			base.OnElementChanged(e);

			var rect = new System.Windows.Shapes.Rectangle();
			rect.DataContext = Element;
			rect.SetBinding(Shape.FillProperty, new System.Windows.Data.Binding("Color") { Converter = new ColorConverter() });
			SetNativeControl(rect);
		}
	}
}