c# - Windows phone 8.1 RT Modify control in another thread -


i have async function. in function modify control in page. detail this

`async public void methodname(){ await ... dosomething; control.visibility = visibity.visible;}` 

and use

 task.run(delegate()  {      getdata();  }); 

to run function in thread (i want function run implicit). have exception this. control can't modify in thread. know should ?

to update ui components separate thread, use so:

await dispatcher.runasync(coredispatcherpriority.normal, () => {     //update ui here }); 

an example can found here around line 113. code there called event of accelerometer, , separate thread. therefore code update text boxes in event wrapped in lines posted above.
hope solve problem :)


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -