/// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            splash = (SplashScreen)e.Parameter;
            OnResize();

            await FaceDetectorService.InitizlizeServiceAsync(SetMediaCapture);
        }
Example #2
0
        /// <summary>
        ///     Initialize Service and add service.
        /// </summary>
        public static async Task InitizlizeServiceAsync(SetMediaCaptureObjectAsync action)
        {
            var devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

            var device   = devices[0];
            var capture  = new MediaCapture();
            var settings = new MediaCaptureInitializationSettings
            {
                VideoDeviceId = device.Id
            };
            await capture.InitializeAsync(settings);

            await action(capture);

            var service = new FaceDetectorService(capture);

            UWPBridgeServiceManager.Instance.AddService <FaceDetectBase>(service);
        }