Hi
I'm trying to create a custom renderer for an Image in my iOS project. The problem is that I can't get any size information. The only thing I get is (see comment in code). I need the correct width and height when I re-create the image in the Blur function.
[assembly: ExportRenderer(typeof (BlurredImage), typeof (BlurredImageRenderer))]
...
public class BlurredImageRenderer : ImageRenderer {
protected override void OnElementChanged(ElementChangedEventArgs<Image> e) {
base.OnElementChanged(e);
var image = Control.Image;
var width = Element.Width; // Returns -1
var height = Element.Height; //Returns -1
var size = image.Size; // Returns width=100, height=100 which is not the size of the image...???
Control.Image = Blur(image, 1f);
}
...
}
Am I doing this to early, before any size information is set?