Reputation: 9903
I'd like to show items in an ItemsControl
in 3*4 pages
One cool feature is that I can change the ItemsPanel
of an ItemsControl
:
for example:
<ItemsControl>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Column='3' Row ='4'/>
...
How can I enable scrolling though? If the panel is a StackPanel
, scrolling/paging is enabled.
But not for UniformGrid
Upvotes: 1
Views: 1975
Reputation: 106
Could use Template instead and put the ScrollViewer inside the ItemsControl and use it for the presentedcontent - this way the content is contained in the scroller not the entire ItemsControl.
<ItemsControl>
<ItemsControl.Template>
<ControlTemplate>
<ScrollViewer>
<ItemsPresenter />
</ScrollViewer>
</ControlTemplate>
</ItemsControl.Template>
</ItemsControl>
Upvotes: 1
Reputation: 178630
It's unclear whether you want paging or scrolling, but I think you mean the latter. That being the case, simply place the ItemsControl
in a ScrollViewer
:
<ScrollViewer>
<ItemsControl ...>
</ItemsControl>
</ScrollViewer>
Upvotes: 2