Working with a listbox in windows phone 7 I am trying to make an async web service call then update the listbox on success.
The method that calls the webservice looks like this:
public void GetReadingList(Action<ObservableCollection<MiniStoryViewModel>> success, Action<string> failure)
I am calling the method with this code:
api.GetReadingList(
(items) => Dispatcher.BeginInvoke(() =>
{
lsbNewest.ItemsSource = items;
}),
(error) =>
{
MessageBox.Show(error);
});
Using this code nothing happens ui wise until I click or scroll on the listbox - then its contents is updated correctly. I am assuming that the code is not being run on the correct thread, how can i fix this?