Esempio n. 1
0
        public static void UpdatePlaceholderColor(this MauiTextView textView, IEditor editor, UIColor?defaultPlaceholderColor)
        {
            Color placeholderColor = editor.PlaceholderColor;

            if (placeholderColor.IsDefault)
            {
                textView.PlaceholderTextColor = defaultPlaceholderColor;
            }
            else
            {
                textView.PlaceholderTextColor = placeholderColor.ToNative();
            }
        }
Esempio n. 2
0
        private protected override void OnHandlerChangedCore()
        {
            base.OnHandlerChangedCore();

            if (Handler != null)
            {
                if (Handler is LabelHandler labelHandler && labelHandler.PlatformView is MauiTextView mauiTextView)
                {
                    _mauiTextView = mauiTextView;
                    _mauiTextView.LayoutChanged += OnLayoutChanged;
                }
            }
            else
            {
                if (_mauiTextView != null)
                {
                    _mauiTextView.LayoutChanged -= OnLayoutChanged;
                    _mauiTextView = null;
                }
            }
        }
Esempio n. 3
0
 public static void UpdatePlaceholder(this MauiTextView textView, IEditor editor)
 {
     textView.PlaceholderText = editor.Placeholder;
 }
Esempio n. 4
0
 public static void UpdatePlaceholderColor(this MauiTextView textView, IEditor editor, UIColor?defaultPlaceholderColor)
 => textView.PlaceholderTextColor = editor.PlaceholderColor?.ToNative() ?? defaultPlaceholderColor;