void OutputPictureBox_MouseDown(object sender, MouseEventArgs e) { var x = (int)Math.Round((e.Location.X - UtilLeft) / CellWidth); var y = (int)Math.Round((e.Location.Y - UtilTop) / CellHeight); _vm.PickAt(x, y); using (var g = OutputPictureBox.CreateGraphics()) Render(g); }
internal View(ViewModel vm) { _vm = vm; InitializeComponent(); OutputPictureBox.Paint += OutputPictureBox_Paint; OutputPictureBox.MouseDown += OutputPictureBox_MouseDown; Resize += (s, e) => OutputPictureBox.Invalidate(); }
private void ResetButton_Click(object sender, EventArgs e) { _vm.Reset(); OutputPictureBox.Invalidate(); }
private void IterateButton_Click(object sender, EventArgs e) { _vm.Iterate(); OutputPictureBox.Invalidate(); }
private void RunButton_Click(object sender, EventArgs e) { _vm.Complete(); OutputPictureBox.Invalidate(); }