Если вы хотите, чтобы ваши ListBox
соответствовали только нужным 10 элементам, для прокрутки остальных можно просто установить высоту ListBoxItem
s равной высоте ListBox
, разделенной на 10.
Если вы хотите разрешить изменение размера ListBox
, вам придется динамически регулировать высоту ListBoxItem
при каждом событии изменения размера.
Статический пример:
<ListBox Height="500">
<ListBox.Resources>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Height" Value="50"/>
</Style>
</ListBox.Resources>
<ListBoxItem>One</ListBoxItem>
<ListBoxItem>Two</ListBoxItem>
<ListBoxItem>Three</ListBoxItem>
<ListBoxItem>Four</ListBoxItem>
<ListBoxItem>Five</ListBoxItem>
<ListBoxItem>Six</ListBoxItem>
<ListBoxItem>Seven</ListBoxItem>
<ListBoxItem>Eight</ListBoxItem>
<ListBoxItem>Nine</ListBoxItem>
<ListBoxItem>Ten</ListBoxItem>
<ListBoxItem>Eleven</ListBoxItem>
<ListBoxItem>Twelve</ListBoxItem>
<ListBoxItem>Thirteen</ListBoxItem>
<ListBoxItem>Fourteen</ListBoxItem>
<ListBoxItem>Fifteen</ListBoxItem>
<!-- etc. -->
</ListBox>