I have a project with various controls some with a name and some without. I want to loop though all controls and automatically set Tag=Name when present. I have seen various solution like this one:
WPF: How do I loop through the all controls in a window?
and this works but then I can't get to set :
foreach (Visual ctrl in MainGrid.GetChildren())
{
ctrl.Tag = ctrl.Name;<------
}
To me the tag is used recognize the event es when pressing different buttons. Thanx Patrick