title: WPF Binding nested objects
body: <p>I'm very new to WPF and I'm having difficulties binding a <em><strong>request</strong></em> object with nested objects  which was derived from a WSDL to a XAML textbox. Programmatically I was able to bind to a textbox but I would like to understand the syntax needed to bind via XAML. Once I have some direction It'll make it much easier to research a full solution. Thanks</p>
  <p>The ResultSet and Message Object will always be [0].</p>
  <h1>Code</h1>
  <pre><code>MainWindow()
  {
      InitializeComponent();
      GetMarketingMessagesResponse request = new GetMarketingMessagesResponse();
      request = (GetMarketingMessagesResponse)XMLSerializerHelper.Load(request, @&quot;C:\SSAResponse.xml&quot;);
      DataContext = request;
      Binding bind = new Binding();
      bind.Source = request.ResultSet[0].Message[0];
      bind.Path = new PropertyPath(&quot;SubjectName&quot;);
      this.txtbSubject.SetBinding(TextBox.TextProperty, bind);
   }
  </code></pre>
  <p>
  The return value in the Visual Studio Watch <em><strong>bind.Source = request.ResultSet[0].Message[0];</strong></em>
  is
  bind.Source = {GetMarketingMessagesResponseResultSetMessage} which is the class name.</p>
  <h1>XAML</h1>
  <p>I'm looking for direction on how to bind to this class and the properties inside</p>
  <pre><code>&lt;TextBox Name=&quot;txtbMessageDetails&quot; HorizontalAlignment=&quot;Right&quot; Margin=&quot;0,50.08,8,0&quot;    TextWrapping=&quot;Wrap&quot; Text=&quot;{Binding Source=ResultSet[0].Message[0], Path=SubjectName}&quot; VerticalAlignment=&quot;Top&quot; Height=&quot;87.96&quot; Width=&quot;287.942&quot;/&gt;
  </code></pre>
  <p></p>