private async void HandleFaceDetectionEffectFaceDetected(FaceDetectionEffect sender, FaceDetectedEventArgs args)
        {
            if(_faceInView)
            {
                return;
            }

            _faceInView = true;
            await TakePhotoAsync();
            await AnalyzePhotoAsync();

            
        }
        private async void FaceDetectionEffect_FaceDetected(FaceDetectionEffect sender, FaceDetectedEventArgs args)
        {
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => HighlightDetectedFaces(args.ResultFrame.DetectedFaces));

            if (launcher == null)
                return;

            await launcher.SetLightAsync(left | right | up | down);

            if (left)
                await launcher.MoveLeftAsync(5);

            if (right)
                await launcher.MoveRightAsync(5);

            if (down)
                await launcher.MoveDownAsync(5);

            if (up)
                await launcher.MoveUpAsync(5);

            if (visible && !up && !down && !left && !right)
                await launcher.FireAsync();
        }
 private async void FaceDetectionEffect_FaceDetected(FaceDetectionEffect sender, FaceDetectedEventArgs args)
 {
     // Ask the UI thread to render the face count information
     await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => CountDetectedFaces(args.ResultFrame.DetectedFaces));
 }
 private async void FaceDetectionEffect_FaceDetected(FaceDetectionEffect sender, FaceDetectedEventArgs args)
 {
     // Ask the UI thread to render the face bounding boxes
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => HighlightDetectedFaces(args.ResultFrame.DetectedFaces));
 }
        private async void FaceDetectionEffect_FaceDetected(FaceDetectionEffect sender, FaceDetectedEventArgs args)
        {
            Debug.WriteLine("Face number: {0}", args.ResultFrame.DetectedFaces.Count);
            

            // Ask the UI thread to render the face bounding boxes
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => HighlightDetectedFaces(args.ResultFrame.DetectedFaces));

            ///检测到人脸,上传到服务器。
            /// 
            

            try
            {
                if (args.ResultFrame.DetectedFaces.Count > faceNumber )
                {
                    faceNumber = args.ResultFrame.DetectedFaces.Count;
                    await SendPhotoAsync();
                }
                else
                {
                    faceNumber = args.ResultFrame.DetectedFaces.Count;
                }


                //
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception when sending a photo: {0}", ex.ToString());
            }
            ;
        }