public static ErrorNode CreateFor(DependencyObject dependencyObject)
        {
            var uiElement = dependencyObject as UIElement;
            if (uiElement != null)
            {
                var bindingExpression = uiElement.Bind(ErrorCountProperty)
                                        .OneWayTo(uiElement, ErrorCountPropertyPath);
                return new ErrorNode(bindingExpression);
            }

            var contentElement = dependencyObject as ContentElement;
            if (contentElement != null)
            {
                var bindingExpression = contentElement.Bind(ErrorCountProperty)
                                        .OneWayTo(contentElement, ErrorCountPropertyPath);
                return new ErrorNode(bindingExpression);
            }

            throw new InvalidOperationException($"Cannot create ErrorNode for type: {dependencyObject?.GetType()}");
        }