This project has moved and is read-only. For the latest updates, please go here.

How to use TaskDialog in Xbap

Dec 8, 2008 at 4:38 PM
Noticed this line on some release notes. What does this mean? "Even TaskDialog (as long as you don't call the Show method)". How do you use taskdialog without calling the show method?

Thanks,
Rod
Dec 9, 2008 at 11:18 AM
Edited Dec 9, 2008 at 11:29 AM

Hi Rod,

The TaskDialog is a FrameworkElement, which means that you can instantiate it and place it in a visual tree, just like any other control. You can see a sample of this in the demo app, by checking the "Show Inline" checkbox. What the (non-static) Show() method does is actually create a Window, place the TaskDialog as its content, and show the window.

Aelij.

Dec 9, 2008 at 2:05 PM
Ok, i found the sample. But how do you capture the result? More importantly, how to stop code execution to capture the result?

Thanks,
Rod
Dec 9, 2008 at 4:56 PM
You don't. You are responsible for showing and hiding the dialog, and for stopping interaction with the surrounding controls. The sample deals with this as well. You can consume the TaskDialog.Closed event to know when to hide the dialog, and then use the Result property to retrieve the result.