Mercurial > silverbladetech
comparison 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 |
comparison
equal
deleted
inserted
replaced
63:536498832a79 | 64:ba89e36631bc |
---|---|
1 namespace SilverlightGlimpse.Test | 1 using System; |
2 using System.Collections.Generic; | |
3 using System.Windows; | |
4 | |
5 namespace SilverlightGlimpse.Test | |
2 { | 6 { |
3 public partial class MainPage | 7 public partial class MainPage |
4 { | 8 { |
5 public MainPage() | 9 public MainPage() |
6 { | 10 { |
7 InitializeComponent(); | 11 InitializeComponent(); |
8 | 12 |
9 // uncomment this exception to view exception on startup | 13 // uncomment this exception to view exception on startup |
10 //throw new Exception("This exception has been thrown to demonstrate an exception during startup", new Exception("This is an inner exception")); | 14 //ThrowNestedException(); |
15 | |
16 var list = new List<object>(5) | |
17 { | |
18 new Person { Id = 1 , Name = "Steve"}, | |
19 new Person { Id = 2 , Name = "Dave"}, | |
20 new Person { Id = 3 , Name = "Bob"}, | |
21 new Person { Id = 4 , Name = "Rich"}, | |
22 new Person { Id = 5 , Name = "Clare"} | |
23 }; | |
24 | |
25 listbox1.ItemsSource = list; | |
26 } | |
27 | |
28 private void ThrowNestedException() | |
29 { | |
30 throw new Exception("Oh dear we've hit an exception!", | |
31 new Exception("This is an inner exception")); | |
32 } | |
33 | |
34 private void btnThrowException_Click(object sender, RoutedEventArgs e) | |
35 { | |
36 ThrowNestedException(); | |
11 } | 37 } |
12 } | 38 } |
39 | |
40 public class Person | |
41 { | |
42 public int Id { get; set; } | |
43 public string Name { get; set; } | |
44 } | |
13 } | 45 } |