如何更改Xamarin.Forms中单击按钮时自定义条目浮动标签的颜色

如何更改Xamarin.Forms中单击按钮时自定义条目浮动标签的颜色,xamarin,xamarin.forms,xamarin.ios,xamarin.android,Xamarin,Xamarin.forms,Xamarin.ios,Xamarin.android,我已经创建了一个带有浮动标签的自定义条目字段,使用类似于此uri的自定义渲染器 我需要更改按钮单击时的条目下划线颜色和占位符颜色 自定义输入代码: 使用系统; 使用System.Collections.Generic; 使用系统文本; 使用System.Text.RegularExpressions; 使用Xamarin.Forms; 命名空间BloodTrace.CustomControls { 公共类XfxEntry:条目 { 公共静态只读BindableProperty ErrorTex

我已经创建了一个带有浮动标签的自定义条目字段,使用类似于此uri的自定义渲染器

我需要更改按钮单击时的条目下划线颜色和占位符颜色

自定义输入代码:

使用系统;
使用System.Collections.Generic;
使用系统文本;
使用System.Text.RegularExpressions;
使用Xamarin.Forms;
命名空间BloodTrace.CustomControls
{
公共类XfxEntry:条目
{
公共静态只读BindableProperty ErrorTextProperty=BindableProperty.Create(nameof(ErrorText),
类型(字符串),
类型(XfxEntry),
默认值(字符串),propertyChanged:OnErrorTextChangedInternal);
public static readonly BindableProperty floatingintenabledproperty=BindableProperty.Create(nameof(floatingintenabled),
类型(bool),
类型(XfxEntry),
正确的);
公共静态只读BindableProperty ActivePlaceholderColorProperty=BindableProperty.Create(nameof(ActivePlaceholderColor),
类型(颜色),
类型(XfxEntry),
颜色、口音);
/// 
///ActivePlaceholder颜色摘要。这是一个可绑定属性。
/// 
公共颜色
{
获取{return(Color)GetValue(ActivePlaceholderColorProperty);}
set{SetValue(ActivePlaceholderColorProperty,value);}
}
公共颜色
{
获取{return(Color)GetValue(ErrorPlaceholderColorProperty);}
set{SetValue(ErrorPlaceholderColorProperty,value);}
}
公共静态只读BindableProperty ErrorPlaceholderColorProperty=BindableProperty.Create(nameof(ErrorPlaceholderColor),
类型(颜色),
类型(XfxEntry),
颜色(绿色);
/// 
///true将提示浮动到标签中,否则为false。这是一个可绑定属性。
/// 
公共图书馆
{
获取{return(bool)GetValue(floatingintentiabledproperty);}
设置{SetValue(floatingIntentiabledProperty,value);}
}
/// 
///获取或设置错误样式是“下划线”还是“无”
/// 
public ErrorDisplay ErrorDisplay{get;set;}=ErrorDisplay.None;
public bool-isErrorColorChange{get;set;}=false;
/// 
///条目的错误文本。空字符串将删除错误。这是一个可绑定属性。
/// 
公共字符串错误文本
{
get{return(string)GetValue(ErrorTextProperty);}
set{SetValue(ErrorTextProperty,value);}
}
/// 
///当错误文本的值更改时引发
/// 
公共事件事件处理程序ErrorTextChanged;
私有静态void OnErrorTextChangedInternal(BindableObject bindable、object oldvalue、object newvalue)
{
var materialEntry=(XfxEntry)可绑定;
materialEntry.OneErrorTextChanged(可绑定、旧值、新值);
materialEntry.ErrorTextChanged?.Invoke(materialEntry,new TextChangedEventArgs((字符串)oldvalue,(字符串)newvalue));
}
受保护的虚拟void OnErrorTextChanged(BindableObject bindable、object oldvalue、object newvalue){}
}
公共枚举错误显示
{
强调
没有一个
}

}
@Diegrafaelsouza,我已经编辑了我的请求并添加了一些代码