Reputation: 847
I am trying to build an application using the unofficial Google music api for .net in Windows 8 metro interface. I am loading the whole playlist
foreach (GoogleMusicPlaylist p in pls.UserPlaylists)
lbPlaylists.Items.Add(p.Title);
and it comes up with this error
HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))
And I read around the internet and maybe I have to use dispatcher or something I am just generally confused.
Upvotes: 2
Views: 2418
Reputation: 39988
Use this
Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
foreach (GoogleMusicPlaylist p in pls.UserPlaylists)
{
lbPlaylists.Items.Add(p.Title);
}
});
Upvotes: 6