I designed a window with WPF, and so I used a lot of Labels. My question now is, if it is possible to get all Labels that are named like this: lblinch, lblinch1, lblinch2 ... . Personally, I would like to store them in an array or in an arraylist. The Labels are not in the same parent-element except for "Window" and the first "Grid".
<Label Content="inch" Name="lblinch2" Grid.Row="0" Grid.Column="2" />
<Label Content="Distance between Beams Manual Input" Grid.Row="1" Grid.Column="0" />
<TextBox Name="tbDistanceBeamsManualInput" Width="{x:Static local:Constants.TOOL_WIDTH}" Grid.Row="1" Grid.Column="1" Margin="0,5,0,5" Background="Yellow" />
<Label Content="inch" Name="lblinch3" Grid.Row="1" Grid.Column="2" />
<Label Content="Bolt Hole Center to Column Wall * =" Grid.Row="2" Grid.Column="0" />
<TextBox Name="tbBHoleCenterToColumnWall" Width="{x:Static local:Constants.TOOL_WIDTH}" Grid.Row="2" Grid.Column="1" Margin="0,5,0,5" Background="Yellow" />
<Label Content="inch" Grid.Row="2" Name="lblinch4" Grid.Column="2" />