// TODO: Simulate Server Validation errors 
        private void DisplayServerErrorMessages(ModelValidationResult validationResult) {
            var serverErrors = new Dictionary<string, ReadOnlyCollection<string>>();

            // Property keys of the form. Format: person.{Property}
            foreach (var propkey in validationResult.ModelState.Keys) {
                //string personPropAndEntityProp = propkey.Substring(propkey.IndexOf('.') + 1); // strip off person. prefix
                string personProperty = propkey.Substring(0, propkey.IndexOf('.') + 1);
                string entityProperty = propkey.Substring(personProperty.IndexOf('.') + 1);

                if (personProperty.ToLower().Contains("person")) {
                    serverErrors.Add(entityProperty, new ReadOnlyCollection<string>(validationResult.ModelState[propkey]));
                }
            }

            if (serverErrors.Count > 0) {
                SelectedPersonVM.Errors.SetAllErrors(serverErrors);
            }
        }
 public ModelValidationException(ModelValidationResult validationResult) {
     ValidationResult = validationResult;
 }