コード例 #1
0
 private void UpdateGridSize(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
 {
     GoLV.GridHeight = SizeValue;
     GoLV.GridWidth  = 2 * SizeValue;
     GoLV.UpdateDimensions();
     VB.UpdateLayout();
     SizeLabel.Content = String.Format("Size: {0}x{1}", GoLV.GridWidth, GoLV.GridHeight);
 }
コード例 #2
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext     = this;
     timer           = new DispatcherTimer(DispatcherPriority.Render);
     timer.Interval  = TimeSpan.FromSeconds(SpeedValue);
     timer.Tick     += Next;
     GoLV.GridHeight = SizeValue;
     GoLV.GridWidth  = 2 * SizeValue;
     GoLV.UpdateDimensions();
     SizeLabel.Content       = String.Format("Size: {0}x{1}", GoLV.GridWidth, GoLV.GridHeight);
     GenerationLabel.Content = "Generation " + GoLV.Generation;
 }
コード例 #3
0
 private void Window_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (timer.IsEnabled)
         {
             timer.Stop();
         }
         else
         {
             timer.Start();
         }
     }
     else if (e.Key == Key.Space)
     {
         GoLV.StepGeneration();
         GenerationLabel.Content = "Generation " + GoLV.Generation;
     }
 }
コード例 #4
0
 private void ClearButtonClick(object sender, RoutedEventArgs e)
 {
     GoLV.Clear();
     timer.Stop();
     GenerationLabel.Content = "Generation " + GoLV.Generation;
 }
コード例 #5
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     GoLV.StepGeneration();
     GenerationLabel.Content = "Generation " + GoLV.Generation;
 }
コード例 #6
0
 private void Next(object sender, EventArgs e)
 {
     GoLV.StepGeneration();
     GenerationLabel.Content = "Generation " + GoLV.Generation;
 }