c# - Async Await to Keep Event Firing -
i have question async\await in c# .net app. i'm trying solve problem in kinect based application me illustrate, i've crafted analogous example: imagine have timer, called timer1 has timer1_tick event set up. now, action take on event update ui current date time. private void timer1_tick(object sender, eventargs e) { txttimervalue.text = datetime.now.tostring("hh:mm:ss.fff", cultureinfo.invariantculture); } this simple enough, ui updates every few hundredths of seconds , can happily watch time go by. now imagine want calculate first 500 prime numbers in same method so: private void timer1_tick(object sender, eventargs e) { txttimervalue.text = datetime.now.tostring("hh:mm:ss.fff", cultureinfo.invariantculture); list<int> primenumberslist = workoutfirstnprimenumbers(500); printprimenumberstoscreen(primenumberslist); } private list<int> workoutfirstnprimenumbers(int n) { ...