Build a UserControl based on a file (WPF)

0

Suppose I have this code in XAML

     <StackPanel>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="4*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <CheckBox Grid.Column="0" Margin="4" IsChecked="True" Content="Acometida 5P (4mm)"/>
        <TextBox Grid.Column="1" Margin="1" Text="1"/>
        <TextBlock Grid.Column="2" Margin="1" Text="32" Background="#eee"/>
        <TextBlock Grid.Column="3" Margin="1" Text="32" Background="#eee"/>
    </Grid>
    </StackPanel>

And with this code I generate the following control;

I would like that, without touching the XAML, I could generate new reference lines in which to keep new components so that each time that view is loaded all the references that I have been putting into the file (if it is a file) I'm new to WPF and like I'm asking for something very obvious or easy to do but right now I would not know very well how ... I would give the same thing as file type use for it, the only thing I need is to have as many references as I need.

Is there a "professional" way to do it or at least with good practices? I would not like to do it in a home plan, the idea is to do it well and learn, after all it's a program I'm doing to practice.

Thank you very much

    
asked by Edulon 25.05.2018 в 18:35
source

0 answers