private IList <string> GetErrorsImpl(string propertyName) { var result = new List <string>(); var maxNumberOfShelfs = ElementDimension.MaximumNumberOfShelfs(this.Height); if (propertyName == NotificationObject.PropertyName(() => this.NumberOfShelfs)) { if (this.NumberOfShelfs > maxNumberOfShelfs) { result.Add(string.Format("Too many shelfs; maximum for this height is {0}", maxNumberOfShelfs)); } } else if (propertyName == NotificationObject.PropertyName(() => this.Width)) { if (this.Width != this.Parent.Width) { result.Add("Width of item does not fit to width of element"); } } return(result); }
public string this[string columnName] { get { var maxNumberOfShelfs = ElementDimension.MaximumNumberOfShelfs(this.Height); if (columnName == NotificationObject.PropertyName(() => this.NumberOfShelfs)) { if (this.NumberOfShelfs > maxNumberOfShelfs) { return(string.Format("Too many shelfs; maximum for this height is {0}", maxNumberOfShelfs)); } } else if (columnName == NotificationObject.PropertyName(() => this.Width)) { if (this.Width != this.Parent.Width) { return("Width of item does not fit to width of element"); } } return(string.Empty); } }
private void OnParentChanged(object _, PropertyChangedEventArgs ea) { this.RaiseErrorsChanged(NotificationObject.PropertyName(() => this.Width)); }
protected virtual void RaisePropertyChanged <T>(Expression <Func <T> > ex) { this.RaisePropertyChanged(NotificationObject.PropertyName(ex)); }