Beispiel #1
0
 public static Color ToOouiColor(this Xamarin.Forms.Color color, Ooui.Color defaultColor)
 {
     if (color == Xamarin.Forms.Color.Default)
     {
         return(defaultColor);
     }
     return(ToOouiColor(ref color));
 }
Beispiel #2
0
        protected override void SetBackgroundColor(Xamarin.Forms.Color color)
        {
            if (Element == null)
            {
                return;
            }

            var elementColor = Element.Color;

            if (!elementColor.IsDefault)
            {
                _colorToRenderer = elementColor.ToOouiColor();
            }
            else
            {
                _colorToRenderer = Colors.Clear;
            }

            Style.BackgroundColor = _colorToRenderer;
        }
Beispiel #3
0
        protected override void OnElementChanged(ElementChangedEventArgs <Entry> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                e.OldElement.FocusChangeRequested -= Element_FocusChangeRequested;
            }

            if (e.NewElement == null)
            {
                return;
            }

            e.NewElement.FocusChangeRequested += Element_FocusChangeRequested;

            if (Control == null)
            {
                var textField = new Ooui.TextInput();
                SetNativeControl(textField);

                Debug.Assert(Control != null, "Control != null");

                textField.ClassName = "form-control";

                _defaultTextColor = Colors.Black;

                textField.Input  += OnEditingChanged;
                textField.Change += OnEditingEnded;
            }

            UpdatePlaceholder();
            UpdatePassword();
            UpdateText();
            UpdateColor();
            UpdateFont();
            UpdateKeyboard();
            UpdateAlignment();
        }