public static void Toggle(this Rectangle r) { RectangleTag t = (RectangleTag)r.Tag; t.Board[t.Column, t.Row] = !t.Board[t.Column, t.Row]; r.UpdateFill(); }
public static void UpdateFill(this Rectangle r) { RectangleTag t = (RectangleTag)r.Tag; r.Fill = t.Board[t.Column, t.Row] ? RectangleFactory.aliveBrush : RectangleFactory.deadBrush; }