I need to navigate a TaskDialogPage
to another after an asynchronous operation has completed. Here's my code
TaskDialogPage page = new()
{
//...
}
TaskDialogPage completedPage = new()
{
//...
}
page.Created += async (_, _) =>
{
await DoSomethingThatTakesTime().ConfigureAwait(false);
page.Navigate(completedPage); // NotSupportedException - Illegal thread call
};
I could use Control.Invoke()
method :
page.Invoke(() => page.Navigate(completedPage))
But TaskDialogPage
doesn't inherit from Control
!