public DependencyPropertyValueRule(DependencyPropertySelector selector,
                                    ObjectDeclaration declaration)
 {
     Selector    = selector;
     _hashCode   = selector.GetHashCode() & declaration.GetHashCode();
     Declaration = declaration;
 }
예제 #2
0
        public IStyleRule?GetRule(IMarkupNode markupNode,
                                  Type targetType)
        {
            if (markupNode.TryGetAttributeValue(nameof(DependencyPropertySelector.Property),
                                                out var propertyName))
            {
                if (DependencyProperty.TryGetDependecyProperty(targetType, propertyName, out var depProp))
                {
                    var selector = new DependencyPropertySelector(depProp);

                    var propVal = BuildPropertyValue(depProp, markupNode);

                    var objDeclaration = new ObjectDeclaration(propVal);

                    return(new DependencyPropertyValueRule(selector, objDeclaration));
                }
            }

            throw new NotImplementedException();
        }