这可能很简单,但转换后我看不到数据
public void SearchGrid(int id, ObservableCollection<TestModel> msgField)
{
foreach (var c in msgField)
DisplayColor = c.Id == id ? Brushes.Blue : Brushes.Black;
}
林克:
Enumerable.FirstOrDefault(msgField.Where(x => x.Id == id), x => { DisplayColor = Brushes.CadetBlue; });