Skip to content

MtListBox

Rico Suter edited this page Jul 8, 2015 · 4 revisions
  • Package: MyToolkit.Extended
  • Platforms: WP7SL, WP8SL, WinRT, UWP

A ListBox with additional features.

Features on all supported platforms:

  • ScrolledToEnd event which indicates when the user scrolled to the end of the list. Consider using a list which implements the ISupportIncrementalLoading interface instead (WinRT).
  • InnerMargin property to set a margin around all elements inside the ScrollViewer
  • Every item automatically stretches to the full width of the control.

Features on WinRT, UWP:

  • Transparent background
  • Scrolling events and properties:
    • ScrollingStateChanged event
    • IsScrolling property

Features on WP7SL and WP8SL:

  • Scroll bug fixed

The ScrolledToEnd event

If the event is triggered you have to disable it because otherwise it will be triggered multiple times. Set TriggerScrolledToEndEvents to true if more data has been loaded and added to the list. This way you tell the control that the list is not at the end and the event will no longer be triggered.

public MyPage()
{
	list.ScrolledToEnd += OnScrolledToEnd();
}

public async void OnScrolledToEnd(object sender, ScrolledToEndEventArgs args)
{
	list.TriggerScrolledToEndEvents = false; 
	await LoadData();
	list.TriggerScrolledToEndEvents = true; 
}

Notes

Clone this wiki locally