This project has moved. For the latest updates, please go here.

Programatically close a TaskDialog

Jul 10, 2009 at 3:52 PM


how can I programatically close a TaskDialog and/or programatically press a button?

Jul 14, 2009 at 7:22 AM

You can use the CancelCommand to close the dialog.

There's no simple way currently to emulate a button press, but you can add actual Button instances to the Buttons collection and then use the automation peer to click the button.

Perhaps a better way (depending on your code) is to simply cancel the dialog and save the required state somewhere.