WPF Tabcontrol access to a page within a frame
<p>I have a page with a frame inside a Tabcontrol.  </p>

<p>How do I put a text (let's say, "Test") inside a Textbox control on a page that has been loaded in a frame inside a tab?</p>

<p>XAML:</p>

<pre><code>&lt;TabControl Name="tabDynamic" ItemsSource="{Binding}" SelectionChanged="tabDynamic_SelectionChanged" Margin="0,23,0,0"&gt;
    &lt;TabControl.Resources&gt;
        &lt;DataTemplate x:Key="TabHeader" DataType="TabItem"&gt;
            &lt;DockPanel&gt;
                &lt;Button Name="btnDelete" DockPanel.Dock="Right" Margin="5,0,0,0" Padding="0" Click="btnDelete_Click" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabItem}}, Path=Name}"&gt;
                    &lt;Image Source="Resources/delete.gif" Height="11" Width="11"&gt;&lt;/Image&gt;
                &lt;/Button&gt;
                &lt;TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=TabItem }, Path=Header}" /&gt;
            &lt;/DockPanel&gt;
        &lt;/DataTemplate&gt;
    &lt;/TabControl.Resources&gt;
&lt;/TabControl&gt;
</code></pre>

<p>which then loads a frame with a page:</p>

<pre><code>private TabItem AddTabItem(string TabName)
{
    int count = _tabItems.Count;

    // create new tab item
    TabItem tab = new TabItem();

    tab.Header = TabName;
    tab.Name = string.Format("tab{0}", count);
    tab.HeaderTemplate = tabDynamic.FindResource("TabHeader") as DataTempte;

    tab.MouseDoubleClick += new MouseButtonEventHandler(tab_MouseDoubleClick);

     // add controls to tab item, this case I added just a textbox
    Frame tabFrame = new Frame();
    AMSPage page1 = new AMSPage(TabName);
    tabFrame.Content = page1;
    tab.Content = tabFrame;

    // insert tab item right before the last (+) tab item
    _tabItems.Insert(count - 1, tab);

    return tab;
}
</code></pre>

<p>Now my users can switch between tabs but I have buttons in the window; lets say I press Button 1, and want to put "Test" in Textbox on any of the pages (Selected Tab).</p>