Note that there are some explanatory texts on larger screens.

plurals
  1. PODependencyProperty Binding Does Not Update To Collection CurrentItem
    primarykey
    data
    text
    <p>I am trying to bind a dependency property to a collection's current selection and for reasons I can't seem to grasp, the binding does not update when the collection changes.</p> <p>In the example below, I show two example. One is updating correctly (on the textblock/run), and the other only displays the initial element and doesn't change when the data grid selection changes.</p> <pre class="lang-xml prettyprint-override"><code>&lt;Grid&gt; &lt;Grid.Resources&gt; &lt;CollectionViewSource Source="{Binding Path=List}" x:Key="myViewModel"/&gt; &lt;my:UpdateNotWorking MyObjModel="{Binding Source={StaticResource myViewModel}, Path=CurrentItem}" x:Key="updateNotWorking" /&gt; &lt;/Grid.Resources&gt; &lt;DataGrid ItemsSource="{Binding Source={StaticResource myViewModel}}" Name="mylistbox"/&gt; &lt;TextBlock TextWrapping="Wrap" FontWeight="Bold" Foreground="#FF50CEFF" FontSize="24" TextAlignment="Center" Height="75"&gt; &lt;Run Text="{Binding Source={StaticResource myViewModel}, Path=text}" Foreground="#FF00E200" /&gt; &lt;/TextBlock&gt; &lt;TextBox Text="{Binding Source={StaticResource updateNotWorking}, Path=MyObjModel.text}" Height="22"/&gt; &lt;/Grid&gt; </code></pre> <p>My dependency property in this example is "MyObjModel" on the "UpdateNotWorking" dependency object which is instantiated from the xaml code. </p> <p>I would appreciate any information as to why my property is not updating correctly.</p> <p><a href="https://skydrive.live.com/redir?resid=100AF80ACE896AA0!6327&amp;authkey=!AGK5kaxS6cpFtEg" rel="nofollow">Example Project</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload