O'Reilly logo

Xamarin Blueprints by Michael Williams

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building the CameraView

Our next custom element is the UI object for rendering the native camera. Let's add a new file into the Controls folder called CameraView.cs and implement the first part:

public sealed class CameraView : ContentView 
    { 
        #region Events 
 
        public event EventHandler<Orientation> OrientationChange; 
 
        public event EventHandler<Point> Focus; 
 
        public event EventHandler<bool> AvailabilityChange; 
 
        public event EventHandler<bool> OpenCamera; 
 
        public event EventHandler<bool> Busy; 
 
        public event EventHandler<bool> Flash; 
 
        public event EventHandler<bool> Torch; 
 
        public event EventHandler<bool> Loading; 
 
        public event EventHandler<byte[]> Photo; 
 
        public event EventHandler<float> Widths; 
 
        public event EventHandler Shutter; 
 
        #endregion 
} 

There are many events ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required