开发者

WP7: Get userinput into a running thread (BackgroundWorker)

currently i'm developing a WP7 that contacts a RemoteService within a BackgroundWorker. As Part of the communication the user needs to validate some Data (something like captcha). As the Communication is connection session based and synchronous i can not complete the background worker, ask the user and start a new communication to the server.

So the question is, is there any way to pause the BackgroundWorker, ask the User for input, pass that input into the BackgroundWor开发者_StackOverflowker and unpause the WorkerThread?

Thanks and kind Regards

Kornelis


You could use the MVVMLight Dialog message as described here to send a message to the View to ask it to prompt the user for a message.

In order to pause/unpause the background worker, you could wait on an AutoResetEvent in your background thread, and in the dialog's callback, signal the event to let the background worker know that the response has come back ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜