comparison SilverlightValidation/SilverlightValidation.PL/ViewModels/UserViewModel.cs @ 102:db05a55e3536

INPC tests added
author stevenhollidge <stevenhollidge@hotmail.com>
date Sun, 06 May 2012 12:13:29 +0100
parents d0c2cac12376
children 62477c2e8837
comparison
equal deleted inserted replaced
101:2372846797f0 102:db05a55e3536
3 using System.Linq; 3 using System.Linq;
4 using System.Windows; 4 using System.Windows;
5 using System.Windows.Input; 5 using System.Windows.Input;
6 using FluentValidation; 6 using FluentValidation;
7 using SilverlightValidation.Interfaces; 7 using SilverlightValidation.Interfaces;
8 using SilverlightValidation.Validators;
9 using SilverlightValidation.Models; 8 using SilverlightValidation.Models;
10 using SilverlightValidation.Commands; 9 using SilverlightValidation.Commands;
11 using GalaSoft.MvvmLight.Messaging; 10 using GalaSoft.MvvmLight.Messaging;
12 using SilverlightValidation.Messages; 11 using SilverlightValidation.Messages;
13 12
15 { 14 {
16 public class UserViewModel : ViewModelBase, IUserViewModel, IEditableObject 15 public class UserViewModel : ViewModelBase, IUserViewModel, IEditableObject
17 { 16 {
18 #region Fields 17 #region Fields
19 18
20 private readonly UserModelValidator _validator; 19 private readonly AbstractValidator<IUserModel> _validator;
21 private UserModel _data; 20 private UserModel _data;
22 private UserModel _backup; 21 private UserModel _backup;
23 22
24 #endregion 23 #endregion
25 24
26 #region Constructor 25 #region Constructor
27 26
28 public UserViewModel(UserModel model, UserModelValidator validator) 27 public UserViewModel(UserModel model, AbstractValidator<IUserModel> validator)
29 { 28 {
30 if (model == null) throw new ArgumentNullException("model"); 29 if (model == null) throw new ArgumentNullException("model");
31 if (validator == null) throw new ArgumentNullException("validator"); 30 if (validator == null) throw new ArgumentNullException("validator");
32 31
33 _validator = validator; 32 _validator = validator;