protected PropertyInfo GetPropertyInfo(string propertyName) { return (ProxiedObject.GetType() .GetProperties() .FirstOrDefault(propertyInfo => propertyInfo.Name == propertyName)); }
public virtual bool Validate() { var propertiesToValidate = ProxiedObject.GetType() .GetProperties() .Where(pi => pi.GetCustomAttributes(typeof(ValidationAttribute), true).Length > 0); foreach (var item in propertiesToValidate) { Validate(item); } return(false); }
public override bool TryConvert(ConvertBinder binder, out object result) { if (binder.Type == typeof(INotifyPropertyChanged)) { result = this; return(true); } if (ProxiedObject != null && binder.Type.IsAssignableFrom(ProxiedObject.GetType())) { result = ProxiedObject; return(true); } else { return(base.TryConvert(binder, out result)); } }
private PropertyInfo GetPropertyInfo(string propertyName) { return(ProxiedObject.GetType().GetProperties().First(propertyInfo => propertyInfo.Name == propertyName)); }