Mercurial > silverbladetech
annotate SilverlightGlimpse/SilverlightValidation/Views/UserView.xaml.cs @ 102:db05a55e3536
INPC tests added
author | stevenhollidge <stevenhollidge@hotmail.com> |
---|---|
date | Sun, 06 May 2012 12:13:29 +0100 |
parents | 5172a9b9800c |
children |
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 |
79
5172a9b9800c
Ready to upload to codeplex
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
78
diff
changeset
|
24 //ThrowException(); |
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 { |
79
5172a9b9800c
Ready to upload to codeplex
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
78
diff
changeset
|
35 ThrowException(); |
78
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 |
79
5172a9b9800c
Ready to upload to codeplex
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
78
diff
changeset
|
38 private void ThrowException() |
78
dd6bcd2535b6
Working version
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
77
diff
changeset
|
39 { |
79
5172a9b9800c
Ready to upload to codeplex
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
78
diff
changeset
|
40 throw new Exception("Oh dear we've hit an exception!"); |
77
86ed4919b126
Working version!
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
69
diff
changeset
|
41 } |
69 | 42 } |
43 } |