I have this code:
foreach (var row in App.cardSetWithWordCounts)
{
details.Children.Add(new SeparatorTemplate());
// do some tasks for every row
// in this part of the loop ...
}
我不想在第一次运行foreach
时添加SeparatorTemplate
,但我想执行其他任务。请问有什么建议吗?
我希望在foreach
中执行其余的代码,但第一次循环时不执行添加模板的那一行。
IEnumerable
的生活就不一样了。 - Bluex.Index == 0
,对代码进行相应的执行。 - Patrick Hofman