title: Silverlight - Sending variables between the frame
body: <p>I have one main page in my Silverlight project. I have two frame inside this page. The one called Contents and the other called Footer. What I wonder is, how can I change the variables in the content in the Content of whether that's a click event in the Footer?</p>
  
  <p><strong>In Mainpage.xaml:</strong></p>
  
  <pre><code>&lt;UserControl
      x:Class="SilverlightApplication10.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
      xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"&gt;
  
  
  
          &lt;Grid x:Name="NavigationGrid" &gt;
  
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
                  &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
                  &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
              &lt;/Grid.RowDefinitions&gt;
          &lt;navigation:Frame Grid.Row="1" x:Name="Contents" 
                                Source="/Home" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed"&gt;
              &lt;navigation:Frame.UriMapper&gt;
                  &lt;uriMapper:UriMapper&gt;
                      &lt;uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/&gt;
                      &lt;uriMapper:UriMapping  Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/&gt;
                  &lt;/uriMapper:UriMapper&gt;
              &lt;/navigation:Frame.UriMapper&gt;
          &lt;/navigation:Frame&gt;
  
          &lt;StackPanel Grid.Row="2" Background="Silver" Width="528"&gt;
              &lt;navigation:Frame Grid.Row="1" x:Name="Footer" 
                                Source="/Home" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed"&gt;
                  &lt;navigation:Frame.UriMapper&gt;
                      &lt;uriMapper:UriMapper&gt;
                          &lt;uriMapper:UriMapping Uri="" MappedUri="/Footer/Home.xaml"/&gt;
                          &lt;uriMapper:UriMapping  Uri="/{pageName}" MappedUri="/Footer/{pageName}.xaml"/&gt;
                      &lt;/uriMapper:UriMapper&gt;
                  &lt;/navigation:Frame.UriMapper&gt;
              &lt;/navigation:Frame&gt;
          &lt;/StackPanel&gt;
      &lt;/Grid&gt;
  
  &lt;/UserControl&gt;
  </code></pre>
  
  <p><strong>In /Views/Page2.xaml:</strong></p>
  
  <pre><code>&lt;navigation:Page x:Class="PodcastPlayer.Page2"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
             d:DesignWidth="640" d:DesignHeight="480"
             Title="Page2 Page"&gt;
    &lt;Grid x:Name="LayoutRoot"&gt;
          &lt;MediaElement x:Name="player"   /&gt;
      &lt;/Grid&gt;
  &lt;/navigation:Page&gt;
  </code></pre>
  
  <p><strong>In /Footer/Page2.xaml:</strong></p>
  
  <pre><code>&lt;navigation:Page x:Class="PodcastPlayer.Page2Fotter"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
             d:DesignWidth="640" d:DesignHeight="480"
             Title="Page2 Page"&gt;
    &lt;Grid x:Name="LayoutRoot"&gt;
          &lt;StackPanel  Orientation="Horizontal" &gt;
              &lt;StackPanel Height="30" Width="60" Background="Red"&gt;
                  &lt;TextBlock Padding="10" Foreground="White"&gt;Back&lt;/TextBlock&gt;
              &lt;/StackPanel&gt;
  
              &lt;StackPanel Height="30" Width="60" Margin="10,0,0,0" Background="DarkGreen"&gt;
                  &lt;TextBlock x:Name="playtext" Padding="10" Foreground="White"&gt;Play&lt;/TextBlock&gt;
              &lt;/StackPanel&gt;
  
              &lt;StackPanel Height="30" Width="60"  Margin="10,0,0,0" Background="Red"&gt;
                  &lt;TextBlock Padding="10" Foreground="White"&gt;Next&lt;/TextBlock&gt;
               &lt;/StackPanel&gt;   
          &lt;/StackPanel&gt;
      &lt;/Grid&gt;
  &lt;/navigation:Page&gt;
  </code></pre>
  
  <p>What I want is that when you click the Play button in the footer to player elimente that Media Element play in Contents.</p>
  
  <pre><code>player.Play()
  </code></pre>
  
  <p>The program I write is in VB.NET. But examples can with c# are also accepted with great thanks!</p>