I try to do the following ...
In the main view MainWindow
I generate as many objects ConfigNivel
as I need, these objects are some views that will subsequently lodge other objects of the class ConfigNivel
(other views with options within them) in which other objects will be created with properties that are changed through TextGroups
.
Could I somehow access all the properties of all the objects that I have created in the different views from the MainWindow?
public partial class MainWindow : Window
{
private void ConstruirFilas(int numFilas)
{
for (int i = 1; i < numFilas; i++)
{
StackConfiguracion.Children.Add(new ConfigNivel(i));
}
}
}
public partial class ConfigNivel : UserControl
{
private void Click_Changed(object sender, EventArgs e)
{
spElemento.Children.Clear();
switch (CB_SeleccionGrupo.SelectedIndex)
{
case 0:
spElemento.Children.Add(new Grupos.cuPotencia());
break;
case 1:
spElemento.Children.Add(new Grupos.cuManiobra());
break;
case 2:
spElemento.Children.Add(new Grupos.cuPLC());
break;
case 3:
spElemento.Children.Add(new Grupos.cuBornero());
break;
}
}
}
With an equal image it is clearer, depending on the selections of ComboBox
some objects or others are created.
If it is not clear, I'll edit it.