Mercurial > silverbladetech
annotate SilverlightGlimpse/SilverlightValidation/Views/UserView.xaml.cs @ 78:dd6bcd2535b6
Working version
author | Steven Hollidge <stevenhollidge@hotmail.com> |
---|---|
date | Mon, 23 Apr 2012 22:43:53 +0100 |
parents | 86ed4919b126 |
children | 5172a9b9800c |
rev | line source |
---|---|
77
86ed4919b126
Working version!
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
69
diff
changeset
|
1 using System; |
86ed4919b126
Working version!
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
69
diff
changeset
|
2 using System.Windows; |
86ed4919b126
Working version!
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
69
diff
changeset
|
3 using System.Windows.Browser; |
69 | 4 using System.Windows.Input; |
5 using SilverlightValidation.Models; | |
6 using SilverlightValidation.Validators; | |
7 using SilverlightValidation.ViewModels; | |
8 | |
9 namespace SilverlightValidation.Views | |
10 { | |
11 public partial class UserView | |
12 { | |
13 private UserViewModel vm; | |
14 | |
15 public UserView() | |
16 { | |
17 InitializeComponent(); | |
18 HtmlPage.Document.SetProperty("title", "Silverlight Validation"); | |
19 | |
20 vm = new UserViewModel(UserModel.Create(), new UserModelValidator()); | |
21 this.DataContext = vm; | |
78
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
22 |
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
23 // uncomment this exception to view exception on startup |
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
24 //ThrowNestedException(); |
69 | 25 } |
26 | |
27 private void DatePicker_KeyDown(object sender, KeyEventArgs e) | |
28 { | |
29 if (e.Key != Key.Tab) | |
30 e.Handled = true; | |
31 } | |
77
86ed4919b126
Working version!
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
69
diff
changeset
|
32 |
86ed4919b126
Working version!
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
69
diff
changeset
|
33 private void btnThrowException_OnClick(object sender, RoutedEventArgs e) |
86ed4919b126
Working version!
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
69
diff
changeset
|
34 { |
78
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
35 ThrowNestedException(); |
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
36 } |
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
37 |
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
38 private void ThrowNestedException() |
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
39 { |
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
40 throw new Exception("Oh dear we've hit an exception!", |
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
41 new Exception("This is an inner exception")); |
77
86ed4919b126
Working version!
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
69
diff
changeset
|
42 } |
69 | 43 } |
44 } |