Exemple #1
0
        /// <summary>
        /// 重新开始按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_NewGame_Click(object sender, RoutedEventArgs e)
        {
            RecordLog.WriteLog("Board Size:" + GameSetting.gridRowCount + "*" + GameSetting.gridColumnCount
                               + "; Game Score:" + txb_Score.Text.ToString()
                               + "; Step Count:" + txb_StepCount.Text.ToString() + ".");

            txb_Score.Text     = "0";
            txb_StepCount.Text = "0";
            txt_Record.Text    = "";
            gameBoard.Reset();
            gameBoard.Children.Clear();
            gridLine = new GridLine(gameBoard);
            InitGame();
        }
Exemple #2
0
        private static void DependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            GridLine gridLine = (GridLine)d;

            gridLine.InvalidateVisual();
        }
Exemple #3
0
 /// <summary>
 /// 窗体加载事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     gridLine = new GridLine(gameBoard);
     InitGame();
 }