title: How to bind property of a ObservableCollection in XAML
body: <p>I have a ChatroomViewModel:</p>
  
  <pre><code>//ObservableObject implements INotifyPropertyChanged
  public class ChatroomViewModel : ObservableObject
  {
      private ObservableCollection&lt;Chat&gt; _chatCollection;
      public ObservableCollection&lt;Chat&gt; ChatCollection
      {
          get { return this._chatCollection;  }
          set
          {
              if (null != value)
              {
                  this._chatCollection = value;
                  OnPropertyChanged("ChatCollection");
              }
          }
      }
  }
  </code></pre>
  
  <p>ChatroomView:</p>
  
  <pre><code>&lt;ListBox Grid.Row="1" ItemsSource="{Binding ChatCollection}"&gt;
      &lt;ListBox.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;StackPanel&gt;
                  &lt;TextBlock Text="Name: "/&gt;
                  &lt;TextBlock Text="{Binding ChatCollection.Name}"/&gt;
                  &lt;TextBlock Text="Created by: "/&gt;
                  &lt;TextBlock Text="{Binding ChatCollection.CreatedBy}"/&gt;
              &lt;/StackPanel&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>This is the ChatModel: </p>
  
  <pre><code>//ObservableDatabaseModel also implements INotifyPropertyChanged
  public class Chat : ObservableDatabaseModel
  {
      private string _name;
      public string Name 
      {
          get { return this._name; }
          set
          {
              this._name = value;
              base.OnPropertyChanged("Name");
          }
      }
  
      private string _createdBy;        
      public string CreatedBy 
      {
          get { return this._createdBy; }
          set
          {
              this._createdBy = value;
              base.OnPropertyChanged("CreatedBy");
          }
      }
  }
  </code></pre>
  
  <p>The binding works but it just show the location of the object, instead of the specified Name/Createdby property text.</p>
  
  <p>I have no idea why this isn't working, I used <code>ObservableCollection&lt;Chat&gt;</code> instead of <code>List&lt;Chat&gt;</code> because it can bind its property too, I have also implemented INotifyPropertyChanged to the "sub-class": Chat.</p>
  
  <p>I'm not using any extra MVVM framework, so I can't do much with a MVVM-light solution or something like that.</p>