var solidColorBrush = textBlock.Background as SolidColorBrush;
if (solidColorBrush != null && solidColorBrush.Color == Colors.Red)//红色才检测
{
BaseMapChange(row.ToString(), col.ToString());
CheckPatternDataGridChange(row.ToString(), col.ToString());
CheckPatternPictureListChange(row.ToString(), col.ToString());
}
参考: