Mercurial > silverbladetech
diff SilverlightGlimpse/SilverlightGlimpse.Test/MainPage.xaml.cs @ 64:ba89e36631bc
Latest version
author | Steven Hollidge <stevenhollidge@hotmail.com> |
---|---|
date | Sun, 22 Apr 2012 14:20:52 +0100 |
parents | 536498832a79 |
children | a0bcd783e612 |
line wrap: on
line diff
--- a/SilverlightGlimpse/SilverlightGlimpse.Test/MainPage.xaml.cs Sun Apr 22 13:33:42 2012 +0100 +++ b/SilverlightGlimpse/SilverlightGlimpse.Test/MainPage.xaml.cs Sun Apr 22 14:20:52 2012 +0100 @@ -1,4 +1,8 @@ -namespace SilverlightGlimpse.Test +using System; +using System.Collections.Generic; +using System.Windows; + +namespace SilverlightGlimpse.Test { public partial class MainPage { @@ -7,7 +11,35 @@ InitializeComponent(); // uncomment this exception to view exception on startup - //throw new Exception("This exception has been thrown to demonstrate an exception during startup", new Exception("This is an inner exception")); + //ThrowNestedException(); + + var list = new List<object>(5) + { + new Person { Id = 1 , Name = "Steve"}, + new Person { Id = 2 , Name = "Dave"}, + new Person { Id = 3 , Name = "Bob"}, + new Person { Id = 4 , Name = "Rich"}, + new Person { Id = 5 , Name = "Clare"} + }; + + listbox1.ItemsSource = list; + } + + private void ThrowNestedException() + { + throw new Exception("Oh dear we've hit an exception!", + new Exception("This is an inner exception")); + } + + private void btnThrowException_Click(object sender, RoutedEventArgs e) + { + ThrowNestedException(); } } + + public class Person + { + public int Id { get; set; } + public string Name { get; set; } + } }