annotate SilverlightGlimpse/SilverlightValidation/Views/UserView.xaml.cs @ 82:352ecaa4fcfd

remove sharpnel
author Steven Hollidge <stevenhollidge@hotmail.com>
date Mon, 23 Apr 2012 23:20:21 +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
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
4 using System.Windows.Input;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
5 using SilverlightValidation.Models;
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 using SilverlightValidation.ViewModels;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
8
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
9 namespace SilverlightValidation.Views
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
10 {
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
11 public partial class UserView
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
12 {
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
13 private UserViewModel vm;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
14
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
15 public UserView()
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
16 {
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
17 InitializeComponent();
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
18 HtmlPage.Document.SetProperty("title", "Silverlight Validation");
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
19
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
20 vm = new UserViewModel(UserModel.Create(), new UserModelValidator());
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
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
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
25 }
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
26
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
27 private void DatePicker_KeyDown(object sender, KeyEventArgs e)
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
28 {
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
29 if (e.Key != Key.Tab)
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
30 e.Handled = true;
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
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
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
42 }
a0bcd783e612 Latest work
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
43 }