Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF: ItemsControl with scrollbar (ScrollViewer)
    primarykey
    data
    text
    <p>I followed <a href="http://compilewith.net/2008/05/making-itemscontrol-scroll.html" rel="noreferrer">this</a> small "tutorial" on how to add a scrollbar to an ItemsControl, and it works in Designer view, but not when I compile and execute the program (only the first few items show up, and no scrollbar to view more - even when VerticalScrollbarVisibility is set to "Visible" instead of "Auto").</p> <p>Any idea on how to solve this?</p> <hr> <p>This is the code I use to show my items (normally I work with Databinding, but to see the items in my Designer I added them manually):</p> <pre><code>&lt;ItemsControl x:Name="itemCtrl" Style="{DynamicResource UsersControlStyle}"&gt; &lt;ItemsControl.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top"&gt; &lt;/StackPanel&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ItemsControl.ItemsPanel&gt; &lt;uc:UcSpeler /&gt; &lt;uc:UcSpeler /&gt; &lt;uc:UcSpeler /&gt; &lt;uc:UcSpeler /&gt; &lt;uc:UcSpeler /&gt; &lt;/ItemsControl&gt; </code></pre> <hr> <p>And this is my Template:</p> <pre><code>&lt;Style x:Key="UsersControlStyle" TargetType="{x:Type ItemsControl}"&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="{x:Type ItemsControl}"&gt; &lt;Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"&gt; &lt;ScrollViewer VerticalScrollBarVisibility="Visible"&gt; &lt;ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/&gt; &lt;/ScrollViewer&gt; &lt;/Border&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre>
    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