示例#1
0
        public Controller(LifeCanvas board)
        {
            _board    = board;
            IsRunning = false;

            _timer = new System.Threading.Timer(o =>
            {
                _board.Update();
            }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
        }
示例#2
0
 private void Play(object sender, RoutedEventArgs e)
 {
     LifeCanvas.Play();
     if (LifeCanvas.IsPlaying)
     {
         PlayButton.Content = "Pause";
     }
     else
     {
         PlayButton.Content = "Play";
     }
 }
示例#3
0
 private void Clear(object send, RoutedEventArgs e)
 {
     LifeCanvas.Clear();
 }
示例#4
0
 private void Randomize(object send, RoutedEventArgs e)
 {
     LifeCanvas.Randomize();
 }