/// <summary>
        /// Validates the value of current cell.
        /// </summary>
        /// <param name="currentCell">
        /// The current cell that is to validated.
        /// </param>
        /// <param name="propertyName">
        /// The propertyName.
        /// </param>
        /// <param name="dataModel">
        /// The dataModel.
        /// </param>
        /// <returns>
        /// <b>true</b> if the validation is successful; otherwise, <b>false</b>.
        /// </returns>
        internal static bool Validate(TreeGridCell currentCell, string propertyName, object dataModel)
        {
            bool hasError       = false;
            var  itemproperties = currentCell.ColumnBase.TreeGridColumn.TreeGrid.View.GetItemProperties();

            // WPF-25016 Using PropertyDescriptorExtensions for WPF and PropertyInfoExtensions for WinRT, the codes are cleaned up
            if (propertyName.Contains('.'))
            {
                var propNames = propertyName.Split('.');
                propertyName = propNames[propNames.Length - 1];
                Array.Resize(ref propNames, propNames.Length - 1);
                var pName = string.Join(".", propNames);
#if WPF
                dataModel = PropertyDescriptorExtensions.GetValue(itemproperties, dataModel, pName);
#else
                dataModel = PropertyInfoExtensions.GetValue(itemproperties, dataModel, pName);
#endif
            }

            if (dataModel == null)
            {
                return(hasError);
            }

#if WPF
            var dataValidation = dataModel as IDataErrorInfo;
            if (dataValidation != null)
            {
                string errormessage = dataValidation[propertyName];
                hasError = !String.IsNullOrEmpty(errormessage);
                if (hasError)
                {
                    currentCell.bindingErrorMessage = errormessage;
                }

                currentCell.ApplyValidationVisualState();
                return(!hasError);
            }
#endif
#if !SyncfusionFramework4_0 || UWP
            hasError = !ValidateINotifyDataErrorInfo(currentCell, propertyName, dataModel);
#endif
            return(!hasError);
        }
        internal static bool ValidateINotifyDataErrorInfo(TreeGridCell currentCell, string propertyName, object dataModel)
        {
            bool hasError            = false;
            var  dataErrorValidation = dataModel as INotifyDataErrorInfo;

            currentCell.bindingErrorMessage = string.Empty;
            if (dataErrorValidation != null)
            {
                var errorList = dataErrorValidation.GetErrors(propertyName);
                if (errorList != null)
                {
                    var errorMessage = errorList.Cast <string>().FirstOrDefault();
                    hasError = !String.IsNullOrEmpty(errorMessage);
                    if (hasError)
                    {
                        currentCell.bindingErrorMessage = errorMessage;
                    }
                }
                currentCell.ApplyValidationVisualState();
            }
            return(!hasError);
        }