Ejemplo n.º 1
0
        void UpdateTextColor()
        {
            Color textColor = Element.TextColor;

            BrushHelpers.UpdateColor(textColor, ref _textDefaultBrush,
                                     () => Control.Foreground, brush => Control.Foreground = brush);

            BrushHelpers.UpdateColor(textColor, ref _defaultTextColorFocusBrush,
                                     () => Control.ForegroundFocusBrush, brush => Control.ForegroundFocusBrush = brush);
        }
Ejemplo n.º 2
0
        void UpdatePlaceholderColor()
        {
            Color placeholderColor = Element.PlaceholderColor;

            BrushHelpers.UpdateColor(placeholderColor, ref _placeholderDefaultBrush,
                                     () => Control.PlaceholderForegroundBrush, brush => Control.PlaceholderForegroundBrush = brush);

            BrushHelpers.UpdateColor(placeholderColor, ref _defaultPlaceholderColorFocusBrush,
                                     () => Control.PlaceholderForegroundFocusBrush, brush => Control.PlaceholderForegroundFocusBrush = brush);
        }
Ejemplo n.º 3
0
        protected override void UpdateBackgroundColor()
        {
            base.UpdateBackgroundColor();

            if (Control == null)
            {
                return;
            }

            // By default some platforms have alternate default background colors when focused
            BrushHelpers.UpdateColor(Element.BackgroundColor, ref _backgroundColorFocusedDefaultBrush,
                                     () => Control.BackgroundFocusBrush, brush => Control.BackgroundFocusBrush = brush);
        }