Building the iOS CameraRenderer

Now let's create the actual CustomRenderer that will use this custom iOS object. Add a new file into Renderers | CameraView, call it CameraViewRenderer.cs, and implement the following:

public class CameraViewRenderer : ViewRenderer<CameraView, CameraIOS> { #region Private Properties private CameraIOS bodyshopCameraIOS; #endregion #region Protected Methods protected override void OnElementChanged(ElementChangedEventArgs<CameraView> e) { base.OnElementChanged(e); if (Control == null) { bodyshopCameraIOS = new CameraIOS(); bodyshopCameraIOS.Busy += Element.NotifyBusy; bodyshopCameraIOS.Available += Element.NotifyAvailability; bodyshopCameraIOS.Photo += Element.NotifyPhoto; SetNativeControl(bodyshopCameraIOS); } if (e.OldElement ...

Get Xamarin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.