Note that there are some explanatory texts on larger screens.

plurals
  1. POIndirect binding to child collections in XAML
    primarykey
    data
    text
    <p>I am currently using a Linq template with SubSonic3 to create my models. I have a simple Member class, which has a collection of Notes. A Note class has a PublishedDate and Title properties.</p> <p>I have a UserControl which has a collection of Members for its <code>DataContext</code>. There are two <code>ListBoxes</code> and a bunch of <code>TextBoxes</code> and other controls on it. The first <code>ListBox</code> (membersList) gets its <code>ItemsSource</code> from the <code>UserControl</code> DataContext and it displays a few Member properties in each item. I would like the second <code>ListBox</code> (notesList) to display the Notes collection of the Member selected in the first <code>ListBox</code>.</p> <p>So far on notesList I have:</p> <pre><code>&lt;ListBox ... ItemsSource="{Binding Notes}"...&gt; &lt;DataTemplate&gt; &lt;TextBox Text="{Binding Title}"/&gt; &lt;/DataTemplate&gt; </code></pre> <p>It partially works. When I selected a Member which has Note items there is the correct number of items in <code>notesListBox</code> but this is only visible in the alternating row colours - nothing else! The <code>DataTemplate</code> fails to render the Title of the Note. Basically all the visual styles in the <code>ListBox</code> and <code>ListBoxItem</code> works - alternating colours, selection border, mouseover, etc. but the content is not shown. I have a feeling the problem is my Binding syntax but I can't figure out what's wrong.</p> <p>Any suggestions would be greatly appreciated.</p> <p>Cheers, Dany.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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