view SilverlightValidation/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 241e2f22ed3c
children
line wrap: on
line source

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;
            }
        }
    }
}