¿Cómo conseguir hijos de un contenedor de WPF por tipo?
¿Cómo puedo conseguir los controles de tipo infantil?ComboBox
enMyContainer
Grid
en WPF?
<code><Grid x:Name="MyContainer"> <Label Content="Name" Name="label1" /> <Label Content="State" Name="label2" /> <ComboBox Height="23" HorizontalAlignment="Left" Name="comboBox1"/> <ComboBox Height="23" HorizontalAlignment="Left" Name="comboBox3" /> <ComboBox Height="23" HorizontalAlignment="Left" Name="comboBox4" /> </Grid> </code>
Esta línea me da un error:
<code>var myCombobox = this.MyContainer.Children.GetType(ComboBox); </code>