/// <summary> /// Error handler. /// </summary> private void OnError(object sender, UnhandledExceptionEventArgs error) { error.Handled = true; var dialog = new MessageDialog("Error", error.Message); dialog.ShowAsync().AsTask().Wait(); }
/// <summary> /// Error handler. /// </summary> private void OnError(object sender, UnhandledExceptionEventArgs error) { // Flag handled so app can continue error.Handled = true; // Create error dialog var dialog = new MessageDialog("Error", error.Message); // Show dialog // TODO: Get this working var uiScheduler = TaskScheduler.FromCurrentSynchronizationContext(); var uiFactory = new TaskFactory(uiScheduler); uiFactory.StartNew(() => { dialog.ShowAsync().AsTask().Wait(); }).Wait(); }