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