title: Binding between Data template and ListBox - Windows Phone
body: <p>I'm having problems to do a binding in Windows Phone. Hope you can help me.</p>
  <p>I have the following Data Template:</p>
  <blockquote>
  <p><code>&lt;DataTemplate&gt;</code></p>
  <blockquote>
  <p><code>&lt;TextBox Name=&quot;txt1&quot;/&gt;</code><br />
  <code>&lt;TextBox Name=&quot;txt2&quot;/&gt;</code><br />
  <code>&lt;/DataTemplate&gt;</code></p>
  </blockquote>
  </blockquote>
  <br/>
  <br/>
  <p>I have a ListBox that receives the following Class in the ItemsSource Property:</p>
  <pre><code>public class Product
  {
  
      private int _id;
  
      public int Id
      {
          get { return _id; }
          set { _id = value; }
      }
  
      private string _name;
  
      public string Name
      {
          get { return _name; }
          set { _name = value; }
      }
  
  }
  </code></pre>
  <p>Is there anyway to bind the Text property with the Object of the ListBoxItem like...</p>
  <blockquote>
  <p><code>&lt;TextBox Name=&quot;txt1&quot; Text={Binding ElementName=ListBox, Path=SelectedItem.Product.Name}/&gt;</code></p>
  </blockquote>