示例#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();
            }
        }
示例#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;
                }
            }
        }
示例#3
0
 public static void UpdatePlaceholder(this MauiTextView textView, IEditor editor)
 {
     textView.PlaceholderText = editor.Placeholder;
 }
示例#4
0
 public static void UpdatePlaceholderColor(this MauiTextView textView, IEditor editor, UIColor?defaultPlaceholderColor)
 => textView.PlaceholderTextColor = editor.PlaceholderColor?.ToNative() ?? defaultPlaceholderColor;