示例#1
0
        public void InitializeOnceAtStartup(EgsHostAppBaseComponents hostApp)
        {
            Trace.Assert(hostApp != null);

            RefToHostApp = hostApp;


            if (ApplicationCommonSettings.IsDebuggingInternal)
            {
                CheckIfAllSoundFilesExistOrNot();
            }


            RefToHostApp.CameraViewWindowModel.WindowStateHostApplicationsControlMethod.Value = CameraViewWindowStateHostApplicationsControlMethods.KeepMinimized;
            RefToHostApp.CameraViewBordersAndPointersAreDrawnBy.Value = CameraViewBordersAndPointersAreDrawnByKind.HostApplication;

            RefToHostApp.Device.Settings.IsToSendTouchScreenHidReport.Value = true;
            // In Windows 10, users cannot often tap by sending Hovering State
            if (false)
            {
                RefToHostApp.Device.Settings.IsToSendHoveringStateOnTouchScreenHidReport.Value = true;
            }
            RefToHostApp.Device.Settings.IsToSendEgsGestureHidReport.Value = true;
            // Now this settings cannot be set from SettingsWindow, so I comment out the next line.
            RefToHostApp.Device.Settings.IsToDrawBordersOnCameraViewImageByDevice.Value = false;
            Launcher.InitializeOnceAtStartup(this);

            RefToHostApp.OnePersonBothHandsViewModel.RightHand.IsToUpdateVelocities = false;
            RefToHostApp.OnePersonBothHandsViewModel.LeftHand.IsToUpdateVelocities  = false;

            TutorialLargeCircleAreaButtonList = new List <TutorialLargeCircleAreaButtonModel>();
            TutorialLargeCircleAreaButtonList.Add(TutorialLargeCircleAreaButtonRightTop);
            TutorialLargeCircleAreaButtonList.Add(TutorialLargeCircleAreaButtonRightBottom);
            TutorialLargeCircleAreaButtonList.Add(TutorialLargeCircleAreaButtonLeftBottom);
            TutorialLargeCircleAreaButtonList.Add(TutorialLargeCircleAreaButtonLeftTop);

            Tutorial01StartGestureTraining.InitializeOnceAtStartup(this);
            Tutorial02MoveCursorTraining.InitializeOnceAtStartup(this);
            Tutorial03TapGestureTraining.InitializeOnceAtStartup(this);
            Tutorial04DragGestureTraining.InitializeOnceAtStartup(this);
            Tutorial05FlickGestureTraining.InitializeOnceAtStartup(this);

            OnCultureInfoChanged();
        }
        public void InitializeOnceAtStartup(ZkooTutorialModel zkooTutorialModel)
        {
            Trace.Assert(zkooTutorialModel != null);
            refToZkooTutorialModel = zkooTutorialModel;

            LauncherView.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial00ZkooSetupTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial01StartGestureTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial01StartGestureTraining.InitializeOnceAtStartup(this, refToZkooTutorialModel.Tutorial01StartGestureTraining);
            Tutorial02MoveCursorTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial02MoveCursorTraining.InitializeOnceAtStartup(this, refToZkooTutorialModel.Tutorial02MoveCursorTraining);
            Tutorial03TapGestureTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial03TapGestureTraining.InitializeOnceAtStartup(this, refToZkooTutorialModel.Tutorial03TapGestureTraining);
            Tutorial04DragGestureTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial04DragGestureTraining.InitializeOnceAtStartup(this, refToZkooTutorialModel.Tutorial04DragGestureTraining);
            Tutorial05FlickGestureTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);
            Tutorial05FlickGestureTraining.InitializeOnceAtStartup(this, refToZkooTutorialModel.Tutorial05FlickGestureTraining);
            Tutorial06BothHandsGestureTutorialVideo.InitializeOnceAtStartup(this, refToZkooTutorialModel);

            UpdatePagesSize();

            Tutorial00ZkooSetupTutorialVideo.Loaded        += delegate { OnTutorial00Moved(); };
            Tutorial01StartGestureTutorialVideo.Loaded     += delegate { OnTutorial01Moved(); };
            Tutorial01StartGestureTraining.Loaded          += delegate { OnTutorial01Moved(); };
            Tutorial02MoveCursorTutorialVideo.Loaded       += delegate { OnTutorial02Moved(); };
            Tutorial02MoveCursorTraining.Loaded            += delegate { OnTutorial02Moved(); };
            Tutorial03TapGestureTutorialVideo.Loaded       += delegate { OnTutorial03Moved(); };
            Tutorial03TapGestureTraining.Loaded            += delegate { OnTutorial03Moved(); };
            Tutorial04DragGestureTutorialVideo.Loaded      += delegate { OnTutorial04Moved(); };
            Tutorial04DragGestureTraining.Loaded           += delegate { OnTutorial04Moved(); };
            Tutorial05FlickGestureTutorialVideo.Loaded     += delegate { OnTutorial05Moved(); };
            Tutorial05FlickGestureTraining.Loaded          += delegate { OnTutorial05Moved(); };
            Tutorial06BothHandsGestureTutorialVideo.Loaded += delegate { OnTutorial06Moved(); };

            this.KeyUp += (sender, e) =>
            {
                if (true)
                {
                    if (e.Key == Key.Escape)
                    {
                        ExitTutorial();
                    }
                }
            };

            this.Loaded += (sender, e) =>
            {
                refToZkooTutorialModel.EnableUpdatingCameraViewImageButHideWindow();
            };

            cursorMonitorTimer.Tick += (sender, e) =>
            {
                if (refToZkooTutorialModel.RefToHostApp.OnePersonBothHandsViewModel == null)
                {
                    return;
                }
                var hand = refToZkooTutorialModel.RefToHostApp.OnePersonBothHandsViewModel.FirstFoundHand;
                if (hand == null || hand.IsTracking == false)
                {
                    return;
                }
                NativeMethods.SetCursorPos((int)hand.PositionX, (int)hand.PositionY);
            };
            cursorMonitorTimer.Start();
        }