diff SilverlightGlimpse/Controls/LoadExceptionViewer.xaml.cs @ 59:3591c26bd63e

MVVMLight added
author Steven Hollidge <stevenhollidge@hotmail.com>
date Sat, 21 Apr 2012 19:20:28 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SilverlightGlimpse/Controls/LoadExceptionViewer.xaml.cs	Sat Apr 21 19:20:28 2012 +0100
@@ -0,0 +1,31 @@
+using System;
+
+namespace SilverlightGlimpse.Controls
+{
+    public partial class LoadExceptionViewer
+    {
+        public LoadExceptionViewer()
+        {
+            InitializeComponent();
+        }
+
+        public LoadExceptionViewer(Exception e, string sourceLocation)
+            : this()
+        {
+            this.txtSourceLocation.Text = string.Concat("Source Location: ", sourceLocation);
+
+            Exception ex = e;
+
+            while (ex != null)
+            {
+                this.lbExceptions.Items.Add(ex);
+                ex = ex.InnerException;
+            }
+
+            if (this.lbExceptions.Items.Count > 0)
+            {
+                this.lbExceptions.SelectedIndex = 0;
+            }
+        }
+    }
+}
\ No newline at end of file