Exemplo n.º 1
0
        private PropertyDescriptor GetPropertyDescriptorFromFirstItem(object firstItem)
        {
            if (string.IsNullOrEmpty(this.RelationName) || (firstItem == null))
            {
                return(null);
            }

            var descriptor = ItemsSourceHelper.GetCustomTypeDescriptor(firstItem, firstItem.GetType());

            if (descriptor == null)
            {
                return(null);
            }

            var properties = descriptor.GetProperties();

            if ((properties != null) && (properties.Count > 0))
            {
                return(properties[this.RelationName]);
            }

            return(null);
        }