Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF ListBox does not realise that its items have changed size
    primarykey
    data
    text
    <p>I have a <code>ListBox</code> that contains a number of <code>User</code> items that are <code>DataTemplate</code>d to appear as <code>UserControl</code>s in the <code>ListBox</code>. Each <code>UserControl</code> can be expanded in size. To start with, the <code>ListBox</code> is big enough to display them all in their unexpanded state. The problem that I have is that when a number of these <code>UserControl</code>s are expanded together, they extend out of the <code>ListBox</code>'s visible area. The <code>ListBox</code> does not recognise this fact and no <code>ScrollBar</code>s appear, even when they are set to <code>Visible</code>.</p> <p>I am using <code>DoubleAnimation</code>s to alter the <code>UserControl</code> heights when the user clicks on a button in each one. Is there something that I have to do, or some setting on the <code>ListBox</code> that must be set to get it to register the size changes of the <code>UserControl</code>s that represent its items and display <code>ScrollBar</code>s when needed?</p> <p>Edit>>></p> <p>I have tracked down the problem to a custom <code>WrapPanel</code> that I am using in the <code>ListBox.ItemsPanel</code>. When I remove it, or replace it with a standard <code>WrapPanel</code>, <code>ScrollBar</code>s appear when required. I got the code for the <code>Panel</code> from a good article about <a href="http://www.switchonthecode.com/tutorials/wpf-tutorial-creating-a-custom-panel-control" rel="nofollow">creating custom WPF panels</a>. Can anyone see what's missing from the code given in the article and why it might stop the <code>ScrollBar</code>s from displaying?</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