diff options
Diffstat (limited to 'Xamarin.Forms.Platform.WP8/BoxViewRenderer.cs')
-rw-r--r-- | Xamarin.Forms.Platform.WP8/BoxViewRenderer.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WP8/BoxViewRenderer.cs b/Xamarin.Forms.Platform.WP8/BoxViewRenderer.cs new file mode 100644 index 00000000..84650996 --- /dev/null +++ b/Xamarin.Forms.Platform.WP8/BoxViewRenderer.cs @@ -0,0 +1,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); + } + } +}
\ No newline at end of file |