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
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
1 using System;
69
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 64
diff changeset
2 using System.Linq;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 64
diff changeset
3 using System.Net;
64
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
4 using System.Windows;
69
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 64
diff changeset
5 using System.Windows.Controls;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 64
diff changeset
6 using System.Windows.Documents;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 64
diff changeset
7 using System.Windows.Input;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 64
diff changeset
8 using System.Windows.Media;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 64
diff changeset
9 using System.Windows.Media.Animation;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 64
diff changeset
10 using System.Windows.Shapes;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 64
diff changeset
11 using System.Windows.Navigation;
64
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
12
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
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
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
21 //ThrowNestedException();
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
22
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
23 var list = new List<object>(5)
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
24 {
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
25 new Person { Id = 1 , Name = "Steve"},
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
26 new Person { Id = 2 , Name = "Dave"},
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
27 new Person { Id = 3 , Name = "Bob"},
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
28 new Person { Id = 4 , Name = "Rich"},
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
29 new Person { Id = 5 , Name = "Clare"}
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
30 };
69
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 64
diff changeset
31
64
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
32 listbox1.ItemsSource = list;
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
33 }
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
34
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
35 private void ThrowNestedException()
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
36 {
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
37 throw new Exception("Oh dear we've hit an exception!",
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
38 new Exception("This is an inner exception"));
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
39 }
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
40
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
41 private void btnThrowException_Click(object sender, RoutedEventArgs e)
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
42 {
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
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
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
46
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
47 public class Person
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
48 {
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
49 public int Id { get; set; }
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
50 public string Name { get; set; }
ba89e36631bc Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 63
diff changeset
51 }
62
810116cd6b8e ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
52 }