解决办法:
I had the same problem with something like @foreach (var item in Model) { @Html.DisplayFor(m => !item.IsIdle, "BoolIcon") }
I solved this just by doing @foreach (var item in Model) { var active = !item.IsIdle; @Html.DisplayFor(m => active , "BoolIcon") }