private async void _faceDetectionEffect_FaceDetectedAsync()

in src/CognitiveKioskUWP/MainPage.xaml.cs [281:310]


        private async void _faceDetectionEffect_FaceDetectedAsync(FaceDetectionEffect sender, FaceDetectedEventArgs args)
        {
            if (args.ResultFrame.DetectedFaces.Count > 0)
            {
                try
                {

                    if (!isFaceFound || DateTime.Now.Subtract(faceLastDate).TotalMinutes > 5)
                    {
                        Analytics.TrackEvent("Faces found, starting capture");
                        isFaceFound = true;
                        await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
                        {
                            timerFace.Stop();
                            timerFace.Start();
                            await ActivateUI();
                        });
                    }
                    faceLastDate = DateTime.Now;
                                                        

                }
                catch (Exception)
                {
                    // eat error
                }
                //await ContCapture();

            }
        }