I’m trying to each element I add a unique name which I get from the loop. How can I accomplish it? The line 2 is where is the error.
foreach (var station in stations) {
TextBlock station.name = new TextBlock(); // error !!!
}
Try this instead…