i have created a custom SFNumericUpDown with a bindable proprety called DisabledColor
public Color DisabledColor
{
get { return (Color)GetValue(DisabledColorProperty); }
set { SetValue(DisabledColorProperty, value); if (!IsEnabled) TextColor = value; }
}
public static readonly BindableProperty DisabledColorProperty = BindableProperty.Create(
nameof(DisabledColor),
returnType: typeof(Color),
declaringType: typeof(MyNumericUpDown),
defaultValue: Color.Black,
defaultBindingMode: BindingMode.TwoWay);
and in my android render
[assembly: ExportRenderer(typeof(MyNumericUpDown), typeof(MyNumericUpDownRender))]
namespace Comodor.Droid.CustomConttrols
{
class MyNumericUpDownRender: SfNumericUpDownRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<SfNumericUpDown> e)
{
base.OnElementChanged(e);
if (Control != null)
{
var dp = (MyNumericUpDown)Element;
if (!dp.IsEnabled)
{
Control.TextColor = dp.DisabledColor.ToAndroid();
}
}
}
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (e.PropertyName.Equals("IsEnabled"))
{
var dp = (MyNumericUpDown)Element;
if (!dp.IsEnabled)
{
Control.TextColor = dp.DisabledColor.ToAndroid();
}
else
{
Control.TextColor=dp.TextColor.ToAndroid();
}
}
}
}
}
but the problem when I Disable the NumericUPdown the color turn in gray.
Any way to change the color of disabled NumericUPdown Control?