public static void PaintChildrenCells(List <GridCell> blinkingCells) { foreach (GridCell blinkingCell in blinkingCells) { int index = GridHelper.CalculateIndexFromCoordinates(blinkingCell.Cell); MutantRectangle rectangleAtIndex = (_grid.Children[index] as MutantRectangle); if (rectangleAtIndex.Content.GetType() != typeof(GenericBuildingComponent)) { rectangleAtIndex.Content = blinkingCell; rectangleAtIndex.Fill = blinkingCell.Fill; } } }