public AddEmployeePageViewModel(INavigationService navigationService, IEmployeesService employeesService, IUserDialogs userDialogs) : base(navigationService) { _employeesService = employeesService ?? throw new ArgumentNullException(nameof(employeesService)); _userDialogs = userDialogs ?? throw new ArgumentNullException(nameof(userDialogs)); _employee = new EmployeeValidableObject(Guid.NewGuid()); Title = "Add Employee"; ValidateFirstNameCommand = new DelegateCommand(ValidateFirstName); ValidateLastNameCommand = new DelegateCommand(ValidateLastName); ValidateEmailCommand = new DelegateCommand(ValidateEmail); ValidateAddressLineCommand = new DelegateCommand(ValidateAddressLine); ValidateCityCommand = new DelegateCommand(ValidateCity); ValidateCountryCommand = new DelegateCommand(ValidateCountry); SaveEmployeeCommand = new DelegateCommand(SaveEmployee); }
public override void OnNavigatingTo(NavigationParameters parameters) { var employee = parameters.GetValue <Employee>("employee"); Employee = employee.ToValidatableObject(); }