c# XAML Access UserControl from other UserControl on same page
<p>Similar question already answered <a href="https://stackoverflow.com/questions/14054959/find-user-controls-control-from-another-user-control-in-same-page">here</a>. The difference is that I have the following structure for my Page-UserControl1-UserControl2:</p>

<p>On the Page I have a ListBox with several ListBoxItems whith each Item is based on the UserControl1. The UserControl is also based on the same Page but there is only one instance of it.</p>

<p>As I linked the other thread, I can't do the following:</p>

<p>I introduced a property at the top of Control1 code-behind:</p>

<pre><code> public Control2 ctrl2 { get; set; }
</code></pre>

<p>And then I gave the Control2 a name in the xaml file of the Page:</p>

<pre><code>&lt;local:Control2 Grid.Row="2" x:Name="NameOfControl2"&gt;&lt;/local:Control2&gt;
</code></pre>

<p>The next step I would like to do is to pass the instance of Control2 to the property just set in Control1. So in the OnLoad Method in the code-behind of the  Page I want to do the following which cant work because the instance of Control1 is unknown at this point:</p>

<pre><code>Control1.ctrl2 = NameOfControl;
</code></pre>

<p>With that doing I could access my UserControl2 from each insatance of UserControl1 but how do I do this?</p>

<p>Thanks</p>

<p><strong>//IN RESPONSE TO THE COMMENT FROM AMINE:</strong></p>

<p>this is the xaml of the Page:</p>

<pre><code>        &lt;ListView Grid.Row="1" Margin="0 0 0 5"       
            x:Name = "Box"
            HorizontalAlignment="Center"
            ScrollViewer.VerticalScrollBarVisibility="Auto"
            ContinuumNavigationTransitionInfo.IsEntranceElement="True"&gt;
        &lt;ListView.ItemTemplate&gt;
            &lt;DataTemplate&gt;
                &lt;local:UserControl1 x:Name="NameOfControl1" DataContext="{Binding ElementName=Box,Path=DataContext}"/&gt;
            &lt;/DataTemplate&gt;
        &lt;/ListView.ItemTemplate&gt;
        &lt;ListView.ItemsPanel&gt;
            &lt;ItemsPanelTemplate&gt;
                &lt;VirtualizingStackPanel VerticalAlignment="Bottom"/&gt;
            &lt;/ItemsPanelTemplate&gt;
        &lt;/ListView.ItemsPanel&gt;
    &lt;/ListView&gt;
</code></pre>

<p>And in the code-behind I fill the Items with:</p>

<pre><code>            StandardTweetBox.Items?.Add(MySpecialClass);
            //this.DataContext = NameOfSendControl;
            StandardTweetBox.DataContext = NameOfSendControl;
</code></pre>