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)
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
/// </summary>
public abstract class ViewRenderer<TView, TNativeView> : VisualElementRenderer<TView>
where TView : View
- where TNativeView : Widget
+ where TNativeView : EvasObject
{
GestureDetector _gestureDetector;