title: Binding an ObservableCollection to ListBox (Easy case?)
body: <p>I am <em>really</em> struggling to understand binding. I know there are loads of other threads with much the same title as this one, but they're all trying to do something more complex than I am, and all the answers assume a whole pile of stuff that I just don't get :(</p>
  
  <p>I'm trying to display a dynamically updated message log. I've defined a Message class:</p>
  
  <pre><code>public class Message
  {
      public DateTime Timestamp { get; private set; }
      public string Value { get; private set; }
      public int Severity { get; private set; }
      public Message(string value, int severity)
      {
          Timestamp = DateTime.Now;
          Value = value;
          Severity = severity;
      }
  }
  </code></pre>
  
  <p>I've defined a MessageLog class as simply:</p>
  
  <pre><code>public class MessageLog: ObservableCollection&lt;Message&gt;
  {
      public MessageLog(): base()
      { }
  }
  </code></pre>
  
  <p>In my MainWindow constructor I have a Log property:</p>
  
  <pre><code>public MessageLog Log { get; private set; }
  </code></pre>
  
  <p>In the MainWindow constructor I initialise Log:</p>
  
  <pre><code>public MainWindow()
  {
      InitializeComponent();
      DataContext = this;
      Log = new Model.MessageLog();
      // and so on
  }
  </code></pre>
  
  <p>In the XAML for the main window I have:</p>
  
  <pre><code>&lt;ListBox Name="MessagePanel" Height="100" ItemsSource="{Binding MessageLog}" IsEnabled="False"/&gt;
  </code></pre>
  
  <p>Now if I add Message instances to the MessageLog I expected to see them appear in the ListBox. They don't. What have I missed?</p>
  
  <p>Thanks in advance (and if you can point me somewhere that explains bindings <em>clearly</em> -- especially the view that XAML has of the code and where it can look for things -- then many more thanks on top. At the moment I'm using Matthew McDonald's "Pro WPF 4.5 in C#" and I'm just not getting it.)</p>