private void Initialize() { this.NumChangeCommand = new UserCommand(this.ExecuteNumChangeCommand); this.NewGameCommand = new UserCommand(this.ExecuteNewGameCommand); this.AnswerCommand = new UserCommand(this.ExecuteAnswerCommand); this.OKCommand = new UserCommand(this.ExecuteOKCommand); this.IsOKEnable = true; this.isAnswerEnable = false; this.startTime = DateTime.Now; this.endTime = DateTime.MinValue; if (AppSetting.Settings.HasCustomizeSudoku()) { this.Riddle = AppSetting.Settings.CustomizeSudoku; } else { this.Riddle = BrickNode.CreateNoneSudoku(); } this.LoadFinished = true; timer = new DispatcherTimer(); timer.Tick += (s, e) => { }; timer.Interval = TimeSpan.FromMilliseconds(NewGameSpan); }
private void StartNewGame() { //Create new and empty sudoku. this.Riddle = BrickNode.CreateNoneSudoku(); this.IsOKEnable = true; this.IsAnswerEnable = false; this.TimerState = CalculagraphState.Stop; this.TimerState = CalculagraphState.Reset; this.startTime = DateTime.Now; this.endTime = DateTime.MinValue; }