To ensure good performance when scrolling through rotation elements quickly, you need to wait to anchor the contents of the rotation element until the SelectedIndex changes. Thus, he will not try to communicate while the user quickly switches between Pivot elements; it will only be attached when you stop at the Pivot element.
Then you must set the ItemsSource ListBox property in the Pivot element in the LayoutUpdated event. I use the following extension method:
public static void InvokeOnLayoutUpdated(this FrameworkElement element, Action action) { if (element == null) { throw new ArgumentNullException("element"); } else if (action == null) { throw new ArgumentNullException("action"); }
So then you will have code that looks something like this:
pivot.InvokeOnLayoutUpdate(() => { Dispatcher.BeginInvoke(() => { list.ItemsSource = source; ApplicationBar.IsMenuEnabled = true; }); });
source share