Avatar of G Scott
G Scott
Flag for United States of America asked on

Finding UserControl in Window WPF

I have a window that has a wrap panel.  In that wrap panel I have placed some viewboxes.  In each of the viewboxes I have placed a simple usercontrol.  How do I assign properties to my usercontrols?  I just can't figure out how to drill down and get to my usercontrol properties.  Sorry I have no code to give as a starting point as I am clueless.  Here is my xaml for the page, if that helps:

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:WPF_Custom_Control="clr-namespace:WPF_Custom_Control;assembly=WPF_Custom_Control" x:Class="Window1"
    Title="Window1" Height="1080" Width="1920">
    <Grid>
        <WrapPanel HorizontalAlignment="Left" Height="934" Margin="10,10,0,0" VerticalAlignment="Top" Width="1892">
            <Viewbox Height="100" Width="100" Stretch="Uniform" StretchDirection="Both" Name="vb1">
                <WPF_Custom_Control:UserControl1/>
            </Viewbox>
            <Viewbox Height="100" Width="100" Stretch="Uniform" StretchDirection="Both" Name="vb2">
                <WPF_Custom_Control:UserControl1/>
            </Viewbox>
            <Viewbox Height="100" Width="100" Stretch="Uniform" StretchDirection="Both" Name="vb3">
                <WPF_Custom_Control:UserControl1/>
            </Viewbox>
            <Viewbox Height="100" Width="100" Stretch="Uniform" StretchDirection="Both" Name="vb4">
                <WPF_Custom_Control:UserControl1/>
            </Viewbox>
            <Viewbox Height="100" Width="100" Stretch="Uniform" StretchDirection="Both" Name="vb5">
                <WPF_Custom_Control:UserControl1/>
            </Viewbox>
            <Viewbox Height="100" Width="100" Stretch="Uniform" StretchDirection="Both" Name="vb6">
                <WPF_Custom_Control:UserControl1/>
            </Viewbox>
            <Viewbox Height="100" Width="100" Stretch="Uniform" StretchDirection="Both" Name="vb7">
                <WPF_Custom_Control:UserControl1/>
            </Viewbox>
            <Viewbox Height="100" Width="100" Stretch="Uniform" StretchDirection="Both" Name="vb8">
                <WPF_Custom_Control:UserControl1/>
            </Viewbox>
            <Viewbox Height="100" Width="100" Stretch="Uniform" StretchDirection="Both" Name="vb9">
                <WPF_Custom_Control:UserControl1/>
            </Viewbox>
            <Viewbox Height="100" Width="100" Stretch="Uniform" StretchDirection="Both" Name="vb10">
                <WPF_Custom_Control:UserControl1/>
            </Viewbox>
        </WrapPanel>
        <Button Content="Button" HorizontalAlignment="Left" Margin="116,1003,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>

    </Grid>
</Window>

Open in new window


Thank you for any help on this.
Visual Basic.NET

Avatar of undefined
Last Comment
Fernando Soto

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Fernando Soto

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
G Scott

ASKER
I was thinking this was way more complex.  Thank you so much.
Fernando Soto

Not a problem, glad to help.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck