We love the idea of Forms. We fully understand that the included renderers are simple and in real world app there will be need to create custom ones.
We are now creating a real world app - and it seems that in almost every case when we have need to write custom renderer of something it becomes a nightmare because most of the required properties are either private, internal or can't be overridden.
The last example - I need to extend the EntryCell
with TextColor
property. Seems easy, right?
For iOS:
- The nested
EntryCellTableViewCell
class is private. The only was to access theUITextField
is to iterate theUITableViewCell
'sContentView
subviews - The
PropertyChanged
event handlers are static. OK - this might not be a big deal, since we can attach our own but then... - The
CellRenderer.GetRealCell
is internal (arghhhh) - no way to get the native cell in custom handler.
So it seems that the only way is to use a custom ViewCell
instead of renderer (which is not recommended because of performance - and seems to be totally unneeded here) or use some hacky reflection to access hidden properties. Three dirty hacks just to change the text color!
Xamarin.Forms guys - why is that? We need to make our app look good. Which means accessing and adding many properties not initially available in Forms - and this seems to be almost impossible without hacks (or reimplementing half of Forms stack) in almost every implementation we try to do .