Mercurial > silverbladetech
annotate SilverlightGlimpse/SilverlightGlimpse.Test/MainPage.xaml.cs @ 65:5d0c5cc83a7a
Click event handler added
author | Steven Hollidge <stevenhollidge@hotmail.com> |
---|---|
date | Sun, 22 Apr 2012 14:21:33 +0100 |
parents | ba89e36631bc |
children | a0bcd783e612 |
rev | line source |
---|---|
64 | 1 using System; |
2 using System.Collections.Generic; | |
3 using System.Windows; | |
4 | |
5 namespace SilverlightGlimpse.Test | |
62
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6 { |
63
536498832a79
Latest version before changing bindings to Listbox
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
62
diff
changeset
|
7 public partial class MainPage |
62
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9 public MainPage() |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11 InitializeComponent(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12 |
63
536498832a79
Latest version before changing bindings to Listbox
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
62
diff
changeset
|
13 // uncomment this exception to view exception on startup |
64 | 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(); | |
62
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
37 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
38 } |
64 | 39 |
40 public class Person | |
41 { | |
42 public int Id { get; set; } | |
43 public string Name { get; set; } | |
44 } | |
62
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
45 } |