69
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
1 using System.Windows.Browser;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
2 using System.Windows.Input;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
3 using SilverlightValidation.Data;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
4 using SilverlightValidation.ViewModels;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
5 using SilverlightValidation.Validators;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7 namespace SilverlightValidation.Views
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9 public partial class UserListView
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11 private UserListViewModel vm;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
13 public UserListView()
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
14 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
15 InitializeComponent();
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16 HtmlPage.Document.SetProperty("title", "Silverlight Validation");
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
17
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
18 vm = new UserListViewModel(Factory.CreateUserModels(), new UserModelValidator());
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19 this.DataContext = vm;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
20 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
21
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22 private void DatePicker_KeyDown(object sender, KeyEventArgs e)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
23 {
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
24 if (e.Key != Key.Tab)
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
25 e.Handled = true;
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
26 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
27 }
|
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
28 }
|