我有Entry
,如果条目为空,我想在按下按钮时添加红色边框。因此我需要能够动态地改变颜色。 (标准验证员)
xaml:
<local:BorderChange Placeholder="Example Entry" BorderColor="#ff4444"></local:BorderChange>
PCL控制:
namespace Project
{
public class BorderChange : Entry
{
public string BorderColor
{
get;
set;
}
}
}
iOS Customrenderer:
[assembly: ExportRenderer(typeof(BorderChange), typeof(BorderColorChange))]
namespace Project.iOS
{
public class BorderColorChange : EntryRenderer
{
//init color
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if(Control != null)
{
Control.Layer.BorderColor = UIColor.Blue; //This is where i want to add my color
}
}
}
}
BorderColor
参数?