Mercurial > silverbladetech
comparison SilverlightValidation/SilverlightValidation.PL/ViewModels/UserViewModel.cs @ 98:d0c2cac12376
Latest version
author | stevenhollidge <stevenhollidge@hotmail.com> |
---|---|
date | Sat, 05 May 2012 22:53:40 +0100 |
parents | 1adc1ae981ea |
children | db05a55e3536 |
comparison
equal
deleted
inserted
replaced
97:1adc1ae981ea | 98:d0c2cac12376 |
---|---|
11 using GalaSoft.MvvmLight.Messaging; | 11 using GalaSoft.MvvmLight.Messaging; |
12 using SilverlightValidation.Messages; | 12 using SilverlightValidation.Messages; |
13 | 13 |
14 namespace SilverlightValidation.ViewModels | 14 namespace SilverlightValidation.ViewModels |
15 { | 15 { |
16 public class UserViewModel : ViewModelBase, IUserModel, IEditableObject | 16 public class UserViewModel : ViewModelBase, IUserViewModel, IEditableObject |
17 { | 17 { |
18 #region Fields | 18 #region Fields |
19 | 19 |
20 private readonly UserModelValidator _validator; | 20 private readonly UserModelValidator _validator; |
21 private UserModel _data; | 21 private UserModel _data; |
30 if (model == null) throw new ArgumentNullException("model"); | 30 if (model == null) throw new ArgumentNullException("model"); |
31 if (validator == null) throw new ArgumentNullException("validator"); | 31 if (validator == null) throw new ArgumentNullException("validator"); |
32 | 32 |
33 _validator = validator; | 33 _validator = validator; |
34 _data = model; | 34 _data = model; |
35 _backup = model.Clone(); | 35 _backup = model.Clone() as UserModel; |
36 | 36 |
37 OkCommand = new RelayCommand(OkCommandExecute); | 37 OkCommand = new RelayCommand(OkCommandExecute); |
38 CancelCommand = new RelayCommand(CancelCommandExecute); | 38 CancelCommand = new RelayCommand(CancelCommandExecute); |
39 } | 39 } |
40 | 40 |