In the code below, I would like to display a status message while fetching some data before and not display a dialog populated with that data until the data fetch is complete. But the dialog is instead being displayed before the data gets there.
What am I doing wrong?
Cheers,
Berryl
ProjectSelectionViewModel vm = null;
SetStatus("Fetching data...");
var task = Task.Factory.StartNew(() =>
{
vm = presentationFactory.GetProjectSelectionViewModel();
}
);
task.ContinueWith(t => SetStatus("Finished!!!"), TaskScheduler.FromCurrentSynchronizationContext());
var userAction = uiService.ShowDialog(Strings.ViewKey_ProjectPicker, vm);
// etc.