相关文章推荐
叛逆的花生  ·  Android studio源码-阿里云·  10 月前    · 
乖乖的李子  ·  关于 vite.config.js ...·  1 年前    · 
坚强的紫菜汤  ·  java - Could not ...·  1 年前    · 
ObservableCollection obsColl= new ObservableCollection<string>(){ " 1" , " 2" , " 3" }; foreach ( var data in obsColl) Console.WriteLine(data); private ObservableCollection<calculations> calculate = new ObservableCollection<calculations>();
foreach (Calculations calc in calculate)
//access the property
mailing.Body += calc.Result + "\n";
public class Calculations private string _results; public string Result get { return this ._results; } set { this ._results = value ; }
Aside from the fact that there was no explanation, it doesn't demonstrate anything different to the original solution posted three years earlier. The original solution already demonstrates how to use foreach with an ObservableCollection ; there was no need to resurrect the question to show exactly the same thing!
  • Read the question carefully.
  • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
  •