title: SelectedIndex with OneWayToSource binding does not trigger
body: <p>I have a problem with a particular xaml databinding. 
  I have two listboxes (master-details, so the listboxes have IsSynchronizedWithCurrentItem set to true). I want my viewmodel to know when the selected item on the details listbox changes: I created an int property on my viewmodel  class (i.e. we can call this property  SelInd)and on the details viewmodel I bind this way:</p>
  
  <pre><code>    SelectedIndex="{Binding Mode=OneWayToSource, Path=SelInd}"
  </code></pre>
  
  <p>I get no errors/exceptions at runtime, but the binding does not trigger: my viewmodel's property does not get updated when the selected item changes. If I change the binding mode to TwoWay everything works fine, but that's not what I need. I need it to work with OneWayToSource (btw the same non-working behaviour applies if I bind SelectedItem to SelectedValue properties).</p>
  
  <p>Why do those bindings do not trigger with OneWayToSource?</p>
  
  <p>Here's a more complete code example, just to get the things clearer:
  EDIT: I can't show the real code (NDA) but I'll show here something simpler and similar enough (the Page's DataContext is an instance of the PageViewModel class explained later)
  I just need that my viewmodel class's SelInd property should always reflect the value of SelectedIndex in the second ListBox. I have found alternative methods for doing this  (Event handler in code-behind or an Attached Behaviour) but right now I'm just curious about WHY it doesn't work with OneWayToSource binding.</p>
  
  <pre><code>&lt;Page&gt;
      &lt;ContentControl x:Name="MainDataContext"&gt;
          &lt;Grid DataContext={Binding Path=Masters}&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="*" /&gt;
                  &lt;ColumnDefinition Width="*" /&gt;
  
              &lt;/Grid.ColumnDefinitions&gt;
  
              &lt;ListBox Grid.Column="0"
                  SelectionMode="Single"                           
               IsSynchronizedWithCurrentItem="True"
               ItemsSource="{Binding }"&gt;
                  &lt;ListBox.ItemContainerStyle&gt;
              ...
              &lt;/ListBox.ItemContainerStyle&gt;
              &lt;ListBox.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                  ....
                      &lt;/DataTemplate&gt;
              &lt;/ListBox.ItemTemplate&gt;
              &lt;/ListBox&gt;
  
              &lt;ListBox Grid.Column="1"
                  SelectionMode="Single"                           
                SelectedIndex="{Binding Mode=OneWayToSource,  ElementName=MainDataContext,Path=DataContext.SelInd}"
               IsSynchronizedWithCurrentItem="True"
               ItemsSource="{Binding Path=Details}"&gt;
                  &lt;ListBox.ItemContainerStyle&gt;
              ...
              &lt;/ListBox.ItemContainerStyle&gt;
              &lt;ListBox.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                  ....
                      &lt;/DataTemplate&gt;
              &lt;/ListBox.ItemTemplate&gt;
              &lt;/ListBox&gt;
          &lt;/Grid&gt;
      &lt;/ContentControl&gt;
  &lt;/Page&gt;
  </code></pre>
  
  <p>Here's a sketch of the view model class</p>
  
  <pre><code>public class PageViewModel{
      public ObservableCollection&lt;MasterClass&gt; Masters {get;set;}
  
      public int SelInd {get;set;}
  
      ....
  }
  </code></pre>
  
  <p>And here's MasterClass, it just holds a name and a list of details</p>
  
  <pre><code>public class MasterClass{
      public ObservableCollection&lt;DetailsClass&gt; Details {get;set;}
  
      public String MasterName {get;set;}
  
      ....
  }
  </code></pre>