Silverlight Button Click -


i'm having problems getting silverlight button click event update control's ui element , continue doing other process. example, update text of control , process. i've tried calling updatelayout() method doesn't help.

here sample code:

private void button1_click(object sender, routedeventargs e) {     textblock1.text = "testing";     textblock1.updatelayout();                 updatelayout();     thread.sleep(2000);     textblock1.text = "done"; } 

in sample, textblock1 control never display text "testing".

it's because you've blocked ui thread sleep statement means text block won't update until after it's completed, time you've set text "done".


Comments

Popular posts from this blog

Python __call__ special method practical example -

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -