diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs index b0651340..6d3ed38e 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/BoxViewRenderer.cs @@ -4,20 +4,18 @@ using ERectangle = ElmSharp.Rectangle; namespace Xamarin.Forms.Platform.Tizen { - public class BoxViewRenderer : VisualElementRenderer<BoxView> + public class BoxViewRenderer : ViewRenderer<BoxView, ERectangle> { - ERectangle _control; - public BoxViewRenderer() { } protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e) { - if (_control == null) + if (Control == null) { - _control = new ERectangle(Forms.Context.MainWindow); - SetNativeControl(_control); + var rectangle = new ERectangle(Forms.Context.MainWindow); + SetNativeControl(rectangle); } if (e.NewElement != null) @@ -54,19 +52,19 @@ namespace Xamarin.Forms.Platform.Tizen if (Element.BackgroundColor.IsDefault) { // Set to default color. (Transparent) - _control.Color = EColor.Transparent; + Control.Color = EColor.Transparent; } else { // Use BackgroundColor only if color is default and background color is not default. - _control.Color = Element.BackgroundColor.MultiplyAlpha(Element.Opacity).ToNative(); + Control.Color = Element.BackgroundColor.MultiplyAlpha(Element.Opacity).ToNative(); } } else { // Color has higer priority than BackgroundColor. - _control.Color = Element.Color.MultiplyAlpha(Element.Opacity).ToNative(); + Control.Color = Element.Color.MultiplyAlpha(Element.Opacity).ToNative(); } } } -} +}
\ No newline at end of file |