Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 private void OnParentChanged(object _, PropertyChangedEventArgs ea)
 {
     this.RaiseErrorsChanged(NotificationObject.PropertyName(() => this.Width));
 }
Esempio n. 4
0
 protected virtual void RaisePropertyChanged <T>(Expression <Func <T> > ex)
 {
     this.RaisePropertyChanged(NotificationObject.PropertyName(ex));
 }