Mercurial > silverbladetech
annotate SilverlightGlimpse/SilverlightGlimpse.Test/MainPage.xaml.cs @ 70:39ba36cc82c5
not sure about these...
author | Steven Hollidge <stevenhollidge@hotmail.com> |
---|---|
date | Mon, 23 Apr 2012 11:06:29 +0100 |
parents | a0bcd783e612 |
children | 96e6fbd70f49 |
rev | line source |
---|---|
64 | 1 using System; |
69 | 2 using System.Linq; |
3 using System.Net; | |
64 | 4 using System.Windows; |
69 | 5 using System.Windows.Controls; |
6 using System.Windows.Documents; | |
7 using System.Windows.Input; | |
8 using System.Windows.Media; | |
9 using System.Windows.Media.Animation; | |
10 using System.Windows.Shapes; | |
11 using System.Windows.Navigation; | |
64 | 12 |
13 namespace SilverlightGlimpse.Test | |
62
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
14 { |
63
536498832a79
Latest version before changing bindings to Listbox
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
62
diff
changeset
|
15 public partial class MainPage |
62
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
17 public MainPage() |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
18 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19 InitializeComponent(); |
63
536498832a79
Latest version before changing bindings to Listbox
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
62
diff
changeset
|
20 // uncomment this exception to view exception on startup |
64 | 21 //ThrowNestedException(); |
22 | |
23 var list = new List<object>(5) | |
24 { | |
25 new Person { Id = 1 , Name = "Steve"}, | |
26 new Person { Id = 2 , Name = "Dave"}, | |
27 new Person { Id = 3 , Name = "Bob"}, | |
28 new Person { Id = 4 , Name = "Rich"}, | |
29 new Person { Id = 5 , Name = "Clare"} | |
30 }; | |
69 | 31 |
64 | 32 listbox1.ItemsSource = list; |
33 } | |
34 | |
35 private void ThrowNestedException() | |
36 { | |
37 throw new Exception("Oh dear we've hit an exception!", | |
38 new Exception("This is an inner exception")); | |
39 } | |
40 | |
41 private void btnThrowException_Click(object sender, RoutedEventArgs e) | |
42 { | |
43 ThrowNestedException(); | |
62
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
44 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
45 } |
64 | 46 |
47 public class Person | |
48 { | |
49 public int Id { get; set; } | |
50 public string Name { get; set; } | |
51 } | |
62
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
52 } |