Exemplo n.º 1
0
        /// <summary>
        /// Overlay the full screen view of the image
        /// </summary>
        private void OnShowOverlayGrid(object sender, RoutedEventArgs e)
        {
            GameScreenViewModel viewModel = this.DataContext as GameScreenViewModel;

            if (viewModel.CurrentGame == "OddOneOut")
            {
                VisualStateManager.GoToElementState(OddOneOutGrid, OddOneOutNormalState, false);
                VisualStateManager.GoToElementState(OddOneOutGrid, OddOneOutFadeInState, false);
                OddOneOutGB.Start(viewModel.CurrentPage.KinectGame as OddOneOutGame, OnCloseOverlayGrid);
            }

            if (viewModel.CurrentGame == "SimonSaysGame")
            {
                VisualStateManager.GoToElementState(SimonSaysGrid, NormalState, false);
                VisualStateManager.GoToElementState(SimonSaysGrid, FadeInTransitionState, false);
                SimonSaysBoard.Start(viewModel.CurrentPage.KinectGame as SimonSaysGame, OnCloseOverlayGrid);
            }

            if (this.CurrentGame == "VirtualDrumKit")
            {
                VisualStateManager.GoToElementState(SimonSaysGrid, VirtualDrumKitNormalState, false);
                VisualStateManager.GoToElementState(SimonSaysGrid, VirtualDrumKitFadeInState, false);
            }

            if (this.CurrentGame == "NoGoNo")
            {
                VisualStateManager.GoToElementState(SimonSaysGrid, NoGoNoNormalState, false);
                VisualStateManager.GoToElementState(SimonSaysGrid, NoGoNoFadeInState, false);
            }

            // Always go to normal state before a transition
            //  this.SelectedImage = ((ContentControl)e.OriginalSource).Content as ImageSource;
            //VisualStateManager.GoToElementState(SimonSaysGrid, NormalState, false);
            //VisualStateManager.GoToElementState(SimonSaysGrid, FadeInTransitionState, false);
        }
Exemplo n.º 2
0
 public GameScreen(
     GameScreenViewModel viewModel,
     GameScreenActionModel actionModel,
     Key key = null
 ) : base(key: key) {
     this.viewModel = viewModel;
     this.actionModel = actionModel;
 }
Exemplo n.º 3
0
        private void GameStateUpdateMessage(Message message)
        {
            var gameState = (GameState)message["GameState"];

            Dispatcher.UIThread.Post(() =>
            {
                AppState appState = AppState.GetAppState();
                GameScreenViewModel gameScreen = appState.CurrentWindow as GameScreenViewModel;
                gameScreen.OnGameStateUpdate(gameState);
            });
        }
Exemplo n.º 4
0
        /// <summary>
        /// Close the full screen view of the image
        /// </summary>
        private void OnCloseOverlayGrid(object sender, RoutedEventArgs e)
        {
            GameScreenViewModel viewModel = this.DataContext as GameScreenViewModel;

            if (viewModel.CurrentGame == "OddOneOut")
            {
                VisualStateManager.GoToElementState(OddOneOutGrid, OddOneOutNormalState, false);
                VisualStateManager.GoToElementState(OddOneOutGrid, OddOneOutFadeOutState, false);
            }

            viewModel.CanNavigateToNextPage = true;
            viewModel.IsInteractivePage     = false;
            // Always go to normal state before a transition
            //VisualStateManager.GoToElementState(SimonSaysGrid, NormalState, false);
            //VisualStateManager.GoToElementState(SimonSaysGrid, FadeOutTransitionState, true);
        }