I eventually got this working by forcing the call to scroll the new item into view on the UI thread.
Consider this in a default DataBound application:
private void ApplicationBarIconButton_Click(object sender, EventArgs e) { App.ViewModel.Items.Add(new ItemViewModel { LineOne = "new L1", LineTwo = "new L2", LineThree = "new L3" }); Dispatcher.BeginInvoke(() => MainListBox.ScrollIntoView(MainListBox.Items.Last())); }
Without doing this, the list will scroll to the item which was previously the last on the list.
0 comments:
Post a Comment
I get a lot of comment spam :( - moderation may take a while.