In JavaScript I can loop through a series of elements fairly easily, like so:
var x = 0;
while (document.getElementById("MyElement-" + x)) {
// Do something
x++;
}
What would be the equivalent of doing this in C# with WPF elements?
<Grid x:Name="MyElement_0" />
<Grid x:Name="MyElement_1" />
<Grid x:Name="MyElement_2" />
<!-- Etc... -->
Thanks!