Hi all,
I'm experimenting with Xamarin.Forms and although it looks very promising, I'm already running into a potential limitation trying to work a pretty common scenario, in my opinion. I am hoping it's just something I'm doing wrong, rather than something not (yet) possible. Seeing as documentation is still in an early stage and I couldn't really find anything related to this issue, I'll just raise the question myself.
The default Button class has no support for state images, so the recommended approach from what I've read would be to subclass it and write a custom renderer for the new type. In that custom renderer, you can use the Control property to access the native control.
However, focusing on iOS for this sample, for custom state images to work properly, the UIButton must be constructed with UIButtonType.Custom. The UIButton's ctor is the only way to specify the button type, as far as I know. The Control property is read only, so simply creating one in the custom renderer seems to be a no go. I also found no overridable method to influence the construction of the native control in the renderer.
Am I missing something obvious here? Or am I too impatient with this first release? :-)
Regards,
Jeffrey