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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.