Understanding the Dispatcher in C# -
i'm watching video on asynchronous c# 5, , in example has asynchronous method , lambda callback function. because lambda callback function executes on separate thread, trying alter ui within causes exception.
to mitigate this, uses dispatcher.runasync(...)
however confused this. made new .net 4.5 project , tried find dispatcher class, can't find anywhere. google told me in system.windows.threading namespace don't have dll on computer, system.windows
i don't quite how works - looking @ msdn documentation can't see how dispatcher (which presumably deals threads) stuff on ui thread - runasync method doesn't specify thread operations execute on.
i considered maybe dispatcher runs things on thread used create dispatcher, since can't try out locally due above issue, @ loss.
can direct me solution?
the video have mentioned developing windows store app windows runtime , .net framework 4.5 , uses runasync method of coredispatcher , part of new windows api , in namespace windows.ui.core.
stop 00:20:21 , take @ intellisense
Comments
Post a Comment