annotate SilverlightGlimpse/SilverlightValidation/Views/UserListView.xaml.cs @ 100:9b6855dc165e

Updated System.Windows into Libs
author stevenhollidge <stevenhollidge@hotmail.com>
date Sat, 05 May 2012 23:04:16 +0100
parents 177a9d1eba10
children
rev   line source
72
177a9d1eba10 Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 71
diff changeset
1 using System;
177a9d1eba10 Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 71
diff changeset
2 using System.Windows.Browser;
69
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
3 using System.Windows.Input;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
4 using SilverlightValidation.Data;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
5 using SilverlightValidation.ViewModels;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
6 using SilverlightValidation.Validators;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
7
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
8 namespace SilverlightValidation.Views
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
9 {
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
10 public partial class UserListView
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
11 {
71
96e6fbd70f49 Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 69
diff changeset
12 private readonly UserListViewModel vm;
69
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
13
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
14 public UserListView()
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
15 {
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
16 InitializeComponent();
71
96e6fbd70f49 Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 69
diff changeset
17 HtmlPage.Document.SetProperty("title", "Silverlight Glimpse Demo");
69
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
18
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
19 vm = new UserListViewModel(Factory.CreateUserModels(), new UserModelValidator());
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
20 this.DataContext = vm;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
21 }
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
22
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
23 private void DatePicker_KeyDown(object sender, KeyEventArgs e)
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
24 {
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
25 if (e.Key != Key.Tab)
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
26 e.Handled = true;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
27 }
72
177a9d1eba10 Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 71
diff changeset
28
177a9d1eba10 Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 71
diff changeset
29 private void btnThrowException_Click(object sender, System.Windows.RoutedEventArgs e)
177a9d1eba10 Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 71
diff changeset
30 {
177a9d1eba10 Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 71
diff changeset
31 throw new Exception("Oh dear we've hit an exception!",
177a9d1eba10 Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 71
diff changeset
32 new Exception("This is an inner exception"));
177a9d1eba10 Latest version
Steven Hollidge <stevenhollidge@hotmail.com>
parents: 71
diff changeset
33 }
69
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
34 }
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
35 }