public void InitializeOnceAtStartup(MainNavigationWindow navigator, Tutorial05FlickGestureTrainingPageModel viewModel)
        {
            Trace.Assert(navigator != null);
            Trace.Assert(viewModel != null);

            this.DataContext = viewModel;
            ReferenceToTutorialEachPageModelBase = viewModel;
            ReplayPracticeNextButtonsUserControl.InitializeOnceAtStartup(viewModel.TutorialAppHeaderMenu);
            TutorialAppHeaderMenuUserControl.InitializeOnceAtStartup(viewModel.TutorialAppHeaderMenu);

            refToViewModel = viewModel;

            InitializeScrollArea();

            this.Loaded += (sender, e) =>
            {
                navigator.SetWindowFullScreen();
                navigator.Title = $"{ApplicationCommonSettings.HostApplicationName} Tutorial: Flick Gesture Practice";
                viewModel.OnLoaded();
            };
            this.Unloaded += (sender, e) =>
            {
                viewModel.IsCancelling = true;
            };
        }
        public void InitializeOnceAtStartup(MainNavigationWindow navigator, ZkooTutorialModel appModel)
        {
            Trace.Assert(navigator != null);
            Trace.Assert(appModel != null);
            refToNavigator = navigator;
            refToAppModel  = appModel;

            this.DataContext = refToAppModel;

            ReplayPracticeNextButtonsUserControl.InitializeOnceAtStartup(appModel.TutorialAppHeaderMenu);
            TutorialAppHeaderMenuUserControl.InitializeOnceAtStartup(appModel.TutorialAppHeaderMenu);

            this.PreviewMouseMove += (sender, e) =>
            {
                MouseCursorPositionY = (int)e.GetPosition(this).Y;
                UpdateAppHeaderMenuVisibility();
            };

            TutorialAppHeaderMenuUserControl.MouseEnter += (sender, e) =>
            {
                IsMouseHoveredOnTutorialAppHeaderMenuUserControl = true;
                UpdateAppHeaderMenuVisibility();
            };
            TutorialAppHeaderMenuUserControl.MouseLeave += (sender, e) =>
            {
                IsMouseHoveredOnTutorialAppHeaderMenuUserControl = false;
                UpdateAppHeaderMenuVisibility();
            };

            videoPlayingUserControl.IsPlayingChanged += (sender, e) =>
            {
                UpdateAppHeaderMenuVisibility();
                ReplayPracticeNextButtonsUserControl.Visibility = videoPlayingUserControl.IsPlaying ? Visibility.Collapsed : Visibility.Visible;
            };

            this.Loaded += (sender, e) =>
            {
                // NOTE: This does not change device settings and so on.
                // NOTE: Called from asynchronous Task.Run() called from each Page's Loaded event.
                refToNavigator.Title = this.PageTitle;
                refToNavigator.SetWindowFullScreen();
                refToAppModel.EnableUpdatingCameraViewImageButHideWindow();
                videoPlayingUserControl.SetMediaElementSourceUriByFilePath(Path.Combine(refToAppModel.CurrentResources.TutorialVideoFilesFolderPath, VideoFileNameWithoutDirectory), UriKind.Relative);
                videoPlayingUserControl.Replay();
            };
        }
Exemple #3
0
        public void InitializeOnceAtStartup(MainNavigationWindow navigator, Tutorial02MoveCursorTrainingPageModel viewModel)
        {
            Trace.Assert(navigator != null);
            Trace.Assert(viewModel != null);


            // ---------- videos and state transition ----------
            PracticeSlideShow01VideoUserControl.SetMediaElementSourceUriByFilePath(System.IO.Path.Combine(viewModel.refToAppModel.CurrentResources.TutorialVideoFilesFolderPath, "tutorial_reference_video_2.mp4"), UriKind.Relative);
            PracticeSlideShow01VideoUserControl.IsVisibleChanged += (sender, e) =>
            {
                if (PracticeSlideShow01VideoUserControl.IsVisible)
                {
                    PracticeSlideShow01VideoUserControl.Replay();
                }
                else
                {
                    PracticeSlideShow01VideoUserControl.Pause();
                }
            };
            // ---------- videos and state transition ----------


            this.DataContext = viewModel;
            ReferenceToTutorialEachPageModelBase = viewModel;
            ReplayPracticeNextButtonsUserControl.InitializeOnceAtStartup(viewModel.TutorialAppHeaderMenu);
            TutorialAppHeaderMenuUserControl.InitializeOnceAtStartup(viewModel.TutorialAppHeaderMenu);

            LargeCircleAreaRightTop.InitializeOnceAtStartup(viewModel.TutorialLargeCircleAreaButtonRightTop);
            LargeCircleAreaRightBottom.InitializeOnceAtStartup(viewModel.TutorialLargeCircleAreaButtonRightBottom);
            LargeCircleAreaLeftBottom.InitializeOnceAtStartup(viewModel.TutorialLargeCircleAreaButtonLeftBottom);
            LargeCircleAreaLeftTop.InitializeOnceAtStartup(viewModel.TutorialLargeCircleAreaButtonLeftTop);

            this.Loaded += (sender, e) =>
            {
                navigator.SetWindowFullScreen();
                navigator.Title = $"{ApplicationCommonSettings.HostApplicationName} Tutorial: Move Cursor Practice";
                viewModel.OnLoaded();
                PracticeSlideShow01VideoUserControl.Replay();
            };
            this.Unloaded += (sender, e) =>
            {
                viewModel.IsCancelling = true;
            };
        }
Exemple #4
0
        public void InitializeOnceAtStartup(MainNavigationWindow navigator, ZkooTutorialModel appModel)
        {
            Trace.Assert(navigator != null);
            Trace.Assert(appModel != null);
            refToNavigator = navigator;
            refToAppModel  = appModel;

            ReplayButtonDestinationPage   = refToNavigator.Tutorial01StartGestureTutorialVideo;
            PracticeButtonDestinationPage = refToNavigator.Tutorial01StartGestureTraining;
            NextButtonDestinationPage     = refToNavigator.Tutorial02MoveCursorTutorialVideo;

            MenuStartButtonModel.CommandRaised    += (sender, e) => { Navigate(refToNavigator.Tutorial01StartGestureTutorialVideo); };
            MenuMoveButtonModel.CommandRaised     += (sender, e) => { Navigate(refToNavigator.Tutorial02MoveCursorTutorialVideo); };
            MenuTapButtonModel.CommandRaised      += (sender, e) => { Navigate(refToNavigator.Tutorial03TapGestureTutorialVideo); };
            MenuDragButtonModel.CommandRaised     += (sender, e) => { Navigate(refToNavigator.Tutorial04DragGestureTutorialVideo); };
            MenuFlickButtonModel.CommandRaised    += (sender, e) => { Navigate(refToNavigator.Tutorial05FlickGestureTutorialVideo); };
            MenuMoreButtonModel.CommandRaised     += (sender, e) => { Navigate(refToNavigator.Tutorial06BothHandsGestureTutorialVideo); };
            MenuReplayButtonModel.CommandRaised   += delegate { Navigate(ReplayButtonDestinationPage); };
            MenuPracticeButtonModel.CommandRaised += delegate { Navigate(PracticeButtonDestinationPage); };
            MenuNextButtonModel.CommandRaised     += delegate { Navigate(NextButtonDestinationPage); };

            MenuExitButtonModel.CommandRaised += delegate
            {
                if (ZkooTutorialModel.IsToExitApplicationOrElseNavigateToLauncherWhenTutorialExit)
                {
                    refToNavigator.ExitTutorial();
                }
                else
                {
                    Navigate(refToNavigator.LauncherView);
                }
            };

            DialogReplayButtonModel.CommandRaised   += delegate { Navigate(ReplayButtonDestinationPage); };
            DialogPracticeButtonModel.CommandRaised += delegate { Navigate(PracticeButtonDestinationPage); };
            DialogNextButtonModel.CommandRaised     += delegate { Navigate(NextButtonDestinationPage); };
        }
        public void InitializeOnceAtStartup(MainNavigationWindow navigator, Tutorial04DragGestureTrainingPageModel viewModel)
        {
            Trace.Assert(navigator != null);
            Trace.Assert(viewModel != null);


            // ---------- videos and state transition ----------
            PracticeSlideShow01VideoUserControl.SetMediaElementSourceUriByFilePath(System.IO.Path.Combine(viewModel.refToAppModel.CurrentResources.TutorialVideoFilesFolderPath, "tutorial_reference_video_4.mp4"), UriKind.Relative);
            PracticeSlideShow01VideoUserControl.IsVisibleChanged += (sender, e) =>
            {
                if (PracticeSlideShow01VideoUserControl.IsVisible)
                {
                    PracticeSlideShow01VideoUserControl.Replay();
                }
                else
                {
                    PracticeSlideShow01VideoUserControl.Pause();
                }
            };
            // ---------- videos and state transition ----------


            this.DataContext = viewModel;
            ReferenceToTutorialEachPageModelBase = viewModel;
            ReplayPracticeNextButtonsUserControl.InitializeOnceAtStartup(viewModel.TutorialAppHeaderMenu);
            TutorialAppHeaderMenuUserControl.InitializeOnceAtStartup(viewModel.TutorialAppHeaderMenu);

            LargeCircleAreaRightTop.InitializeOnceAtStartup(viewModel.TutorialLargeCircleAreaButtonRightTop);
            LargeCircleAreaRightBottom.InitializeOnceAtStartup(viewModel.TutorialLargeCircleAreaButtonRightBottom);
            LargeCircleAreaLeftBottom.InitializeOnceAtStartup(viewModel.TutorialLargeCircleAreaButtonLeftBottom);
            LargeCircleAreaLeftTop.InitializeOnceAtStartup(viewModel.TutorialLargeCircleAreaButtonLeftTop);

            var corners           = new FrameworkElement[] { LargeCircleAreaRightTop, LargeCircleAreaRightBottom, LargeCircleAreaLeftBottom, LargeCircleAreaLeftTop };
            var corner_Index_Dict = new Dictionary <object, int>();

            for (int i = 0; i < corners.Length; i++)
            {
                var corner = corners[i];
                corner_Index_Dict[corner] = i;
            }

            this.Loaded += (sender, e) =>
            {
                navigator.SetWindowFullScreen();
                navigator.Title = $"{ApplicationCommonSettings.HostApplicationName} Tutorial: Drag Gesture Practice";
                viewModel.OnLoaded();
                PracticeSlideShow01VideoUserControl.Replay();
            };
            this.Unloaded += (sender, e) =>
            {
                viewModel.IsCancelling = true;
            };

            DraggingThumb.MouseEnter    += (sender, e) => { viewModel.IsDraggingThumbHovered = true; };
            DraggingThumb.MouseLeave    += (sender, e) => { viewModel.IsDraggingThumbHovered = false; };
            DraggingThumb.DragStarted   += (sender, e) => { viewModel.IsDraggingThumbDragging = true; };
            DraggingThumb.DragCompleted += (sender, e) =>
            {
                var thumbRadius = DraggingThumb.ActualWidth / 2;
                var thumbCenterRelativePoint = new Point(thumbRadius, thumbRadius);
                viewModel.DraggingThumbCenterPoint = DraggingThumb.PointToScreen(thumbCenterRelativePoint);
                foreach (var corner in corners)
                {
                    var index        = corner_Index_Dict[corner];
                    var cornerRadius = corner.ActualWidth / 2;
                    var cornerCenterRelativePoint = new Point(cornerRadius, cornerRadius);
                    viewModel.LargeCircleAreaCenterPoint[index] = corner.PointToScreen(cornerCenterRelativePoint);

                    var diffVector = (viewModel.LargeCircleAreaCenterPoint[index] - viewModel.DraggingThumbCenterPoint);
                    var distance   = diffVector.Length;
                    viewModel.ThumbToLargeCircleAreaCenterDistanceList[index]         = distance;
                    viewModel.TutorialLargeCircleAreaButtonList[index].IsThumbDragged = (distance + thumbRadius < cornerRadius);
                }
                viewModel.IsDraggingThumbDragging = false;
            };
        }
Exemple #6
0
        internal void InitializeOnceAtStartup(MainNavigationWindow navigator, ZkooTutorialModel appModel)
        {
            Trace.Assert(navigator != null);
            Trace.Assert(appModel != null);
            refToNavigator = navigator;
            refToAppModel  = appModel;

            this.DataContext = refToAppModel;

            beginnerModeButton.MouseEnter += delegate
            {
                refToViewModel.CursorOveringLauncherButtonSummary            = refToViewModel.BeginnerModeButtonModel;
                refToViewModel.CursorSpeedAndPrecisionModeAndRecommendedApps = refToViewModel.BeginnerModeDetail;
            };
            beginnerModeButton.Click += delegate
            {
                ShrinkAdvancedButtons();
                refToViewModel.IsExtractedAdvancedMode = false;
            };

            standardModeButton.MouseEnter += delegate
            {
                refToViewModel.CursorOveringLauncherButtonSummary            = refToViewModel.StandardModeButtonModel;
                refToViewModel.CursorSpeedAndPrecisionModeAndRecommendedApps = refToViewModel.StandardModeDetail;
            };

#if IsToUseAdvancedButtonsInLauncher
            advancedButton.MouseEnter += delegate { refToViewModel.CursorOveringLauncherButtonSummary = refToViewModel.AdvancedButtonModel; };
            advancedButton.Click      += delegate { ExtractAdvancedButtons(); };

            highSpeedModeButton.MouseEnter += delegate
            {
                refToViewModel.CursorOveringLauncherButtonSummary            = refToViewModel.HighSpeedModeButtonModel;
                refToViewModel.CursorSpeedAndPrecisionModeAndRecommendedApps = refToViewModel.HighSpeedModeDetail;
            };
            highSpeedModeButton.Click += delegate
            {
                ExtractAdvancedButtons();
                refToViewModel.IsExtractedAdvancedMode = true;
            };

            highPrecisionModeButton.MouseEnter += delegate
            {
                refToViewModel.CursorOveringLauncherButtonSummary            = refToViewModel.HighPrecisionModeButtonModel;
                refToViewModel.CursorSpeedAndPrecisionModeAndRecommendedApps = refToViewModel.HighPrecisionModeDetail;
            };
            highPrecisionModeButton.Click += delegate
            {
                ExtractAdvancedButtons();
                refToViewModel.IsExtractedAdvancedMode = true;
            };
#endif

            tutorialVideoButton.MouseEnter += delegate { refToViewModel.CursorOveringLauncherButtonSummary = refToViewModel.TutorialVideoButtonModel; };
            tutorialAppButton.MouseEnter   += delegate { refToViewModel.CursorOveringLauncherButtonSummary = refToViewModel.TutorialAppButtonModel; };
            tutorialAppButton.Click        += delegate { NavigationService.Navigate(refToNavigator.Tutorial01StartGestureTutorialVideo); };
            exitButton.MouseEnter          += delegate { refToViewModel.CursorOveringLauncherButtonSummary = refToViewModel.ExitButtonModel; };
            exitButton.Click += delegate { refToNavigator.ExitTutorial(); };



            this.Loaded += delegate
            {
                refToAppModel.EnableUpdatingCameraViewImageAndShowWindow();
                refToNavigator.Title = $"{ApplicationCommonSettings.HostApplicationName} by {ApplicationCommonSettings.SellerShortName}:  Apps Launcher on BlueStacks (beta version)";
                refToNavigator.SetWindowPositionToCenterOfTheScreen();

                if (refToViewModel.IsExtractedAdvancedMode)
                {
                    ExtractAdvancedButtons();
                }
                else
                {
                    ShrinkAdvancedButtons();
                }
            };

            this.MouseLeftButtonDown += delegate { refToNavigator.DragMove(); };
        }