public BindableProperty GetBindableProperty(BindableObject bindableObj, string propertyName) {
if(typeof(Entry) == bindableObj.GetType()) {
if("Text" == propertyName) {
return (Entry.TextProperty);
}
if("TextColor" == propertyName) {
return (Entry.TextColorProperty);
}
}
return (null);
}
但我不想使用这种“if else”风格。有没有不需要判断类型和名称的通用方法?