Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How can I create a Xamarin.Forms control from a native control?

$
0
0

I am looking to implement a CameraView/CameraPreview in my forms app and I am currently looking to get it to work on iOS first. I have found the following sample: https://github.com/xamarin/ios-samples/blob/master/ios11/AVCam/src/AVCamPreviewView.cs
Note it is extending UIView. So I have made AVCamPreviewView a renderer by extending ViewRender - assuming i'ts valid to change out the UIView to ViewRenderer`. Additionally I wish to add properties, used and accessible inside forms - but having changing effects in native.

public interface ICameraView
{
string TakeImage();
void Start();
void Stop();
}

However having an interface I am forced to also make an implementation on my CameraView inside the my forms project. So I have considered making the CameraView class abstract. But then I can't implement anything in my renderer?

I am not particularly interested in having CameraView extending anything

How can I build a xamarin forms control from a native control?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>