/// <summary> /// Helper method to clear all stats /// </summary> private void Over() { // Every square is "" SquareValue = new SquareValueList(SquaresCount); // From now on any button can execute CanExecuteList = new CanExecuteList(SquaresCount); // new game new board etc. etc. PlaySaper = new Game(); // new Game SaperGameExe(); // Timer Reset(); }
/// <summary> /// Default constructor /// </summary> /// <param name="window"></param> public WindowViewModel(Window window) { // Pass window (needed to minimize and close buttons) _Window = window; // What's the content of the button SquareValue = new SquareValueList(SquaresCount); // Definies if square is active or not CanExecuteList = new CanExecuteList(SquaresCount); // Create Commands MinimizeCommand = new RelayCommand(() => _Window.WindowState = WindowState.Minimized); CloseCommand = new RelayCommand(() => _Window.Close()); LogoCommand = new RelayCommand(() => SystemCommands.ShowSystemMenu(_Window, GetMousePosition())); SquareCommand = new AdvancedRelayCommand(RandomSquare, RandomSquareCanExecute); // Sets up the board SaperGameExe(); }