Update a foreach part

But that update is not proper solution for WPF Window.
Update a foreach part

Latest update for foreach part
Merge pull request #2 from dynamo70/myBranch

My branch