コード例 #1
0
 /// <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();
 }
コード例 #2
0
        /// <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();
        }