Is there a way to use the app while the task is still running?
With my current code, the app is unresponsive while the task executed from the ContentDialog does not finish.
private async void FooContentDialog(object sender, EventArgs e)
{
ContentDialog fooDialog = new ContentDialog
{
// XamlRoot must be set in the case of a ContentDialog running in a Desktop app
XamlRoot = this.Content.XamlRoot,
Style = Application.Current.Resources["DefaultContentDialogStyle"] as Style, /* fade effect*/
Title = "Run time-consuming fooTask?",
PrimaryButtonText = "Yes",
CloseButtonText = "No",
DefaultButton = ContentDialogButton.Primary,
Content = "An extremely time-consuming task will run. Sit back and have a coffee in the meantime."
};
ContentDialogResult result = await fooDialog.ShowAsync();
if (result == ContentDialogResult.None)
{
return;
}
//time-consuming fooTask
fooTask();
}