title: Listbox "IsSelected" binding only partially working
body: <p>I have a <code>ListBox</code> that I populate dynamically via a binding (this is defined in a <code>DataTemplate</code>, which is why the binding is somewhat unusual):</p>
  
  <pre><code>&lt;ListBox SelectionMode="Extended" ItemsSource="{Binding DataContext.ResultList, RelativeSource={RelativeSource AncestorType=Window}}"&gt;
    &lt;ListBox.ItemContainerStyle&gt;
      &lt;Style TargetType="{x:Type ListBoxItem}"&gt;
        &lt;Setter Property="IsSelected" Value="{Binding IsSelected}"/&gt;
      &lt;/Style&gt;
    &lt;/ListBox.ItemContainerStyle&gt;
    &lt;ListBox.ItemTemplate&gt;
      &lt;DataTemplate&gt;
        &lt;Label Content="{Binding Object}"/&gt;
      &lt;/DataTemplate&gt;
    &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>Each <code>ListBoxItem</code>'s <code>IsSelected</code> property is bound to an <code>IsSelected</code> property on a custom object.</p>
  
  <p>When I select individual <code>ListBoxItem</code>s, the binding works properly - the custom object's <code>IsSelected</code> property is updated in my ViewModel.  However, if I select all of the <code>ListBoxItem</code>s with a Ctrl+A command, only the currently visible <code>ListBoxItem</code>s (those that are currently in my scrolling viewport) update their ViewModel bindings.  On the frontend, all the <code>ListBoxItem</code>s appear to be selected, and the <code>ListBox.SelectedItems.Count</code> property on the container <code>ListBox</code> shows that all items are selected.</p>
  
  <p>Furthermore, as I scroll through the <code>ListBox</code> after selecting all <code>ListBoxItem</code>s with Ctrl+A, the bindings are successfully updated when each <code>ListBoxItem</code> is scrolled into view.</p>
  
  <p>Why does this binding seem to be only partially working?  Is there a better way to handle the binding of the <code>IsSelected</code> property when large numbers of <code>ListBoxItems</code> can be selected simultaneously?</p>
  
  <p><strong>Edit:</strong>
  This behavior doesn't happen exclusively with the Ctrl+A command - I get the same results when selecting all the items using a shift+click.</p>