title: How can I bind an ItemsControl.ItemsSource with a property in XAML?
body: <p>I have a simple window :</p>
  
  <pre><code>&lt;Window x:Class="WinActivityManager"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
      &lt;Grid&gt;
          &lt;ListView x:Name="lvItems" /&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>And the associated code behind :</p>
  
  <pre><code>public partial class WinActivityManager : Window
  {
      private ObservableCollection&lt;Activity&gt; Activities { get; set; }
  
      public WinActivityManager()
      {
          Activities = new ObservableCollection&lt;Activity&gt;();
          InitializeComponent();
      }
  
      // Other code ...
  }
  </code></pre>
  
  <p>If I write the following binding in the window constructor :</p>
  
  <pre><code>lvItems.ItemsSource = Activities;
  </code></pre>
  
  <p>then my ListView is automatically updated when I add or remove elements from <code>Activities</code>.</p>
  
  <p><strong>How should I write the binding in XAML?</strong><br>
  I tried this but it doesn't work:</p>
  
  <pre><code>&lt;ListView x:Name="lvItems" ItemsSource="{Binding=Activities}" /&gt;
  </code></pre>
  
  <p>How do I make this work in XAML?</p>