Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a "Load More" button to bottom of listbox results?

Hello I'm making a call to a web service that returns results in pages. These results are bound to a listbox in which they are then displayed. I would like to add a "See More" results button to the bottom of the listbox when they scroll to the bottom. Any resources or suggestions on how to accomplish this are appreciated.

like image 795
Edward Avatar asked Jun 26 '11 00:06

Edward


1 Answers

Here is an example: How to add a Control at the end of Items of a ListBox.

This is simplified version of standard template of ListBox:

<Border CornerRadius="2" 
    BorderBrush="{TemplateBinding BorderBrush}"
    BorderThickness="{TemplateBinding BorderThickness}">
    <ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="0" TabNavigation="{TemplateBinding TabNavigation}">
        <ItemsPresenter />
    </ScrollViewer>
</Border>

You can wrap <ItemsPresenter /> with StackPanel, this will allow you to place any content to the scrollable area before or after list items.

like image 192
Alex Aza Avatar answered Oct 14 '22 16:10

Alex Aza