[UWP] CaptureElement only displays content after resize

DenisOlianaDenisOliana USMember ✭✭
edited December 2015 in Xamarin.Forms

I have a universal Windows app that uses a captureelement to display a camera stream (I set the CaptureElement in a custom renderer vor a View). The thing is, that the stream is only displayed after I manually reset the window (which also resizes the control).

In the renderer I use:

protected override void OnElementChanged(ElementChangedEventArgs<QRScannerControl> e)
{
    captureControl = new CaptureElement();
        this.SetNativeControl(captureControl);
}

to set the element and later in a separate method (on button pressed) I start the stream from a mediacapture element and set the source:

...
mediaCapture = cameraProvider.GetDeviceCameraStream() as MediaCapture;
await mediaCapture.InitializeAsync();
captureControl.Source = mediaCapture;
await mediaCapture.StartPreviewAsync();

What am I missing (I already updated to the latest Xamarin.Forms)?

Answers

Sign In or Register to comment.