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