示例#1
0
        private DependencyProperty(DependencyPropertyHashKey hashKey, Type propertyType, PropertyMetadata metadata, ValidateValueCallback validateValueCallback, bool isAttached, bool isReadOnly)
        {
            this.hashKey               = hashKey;
            this.Name                  = hashKey.Name;
            this.OwnerType             = hashKey.Owner;
            this.PropertyType          = propertyType;
            this.ValidateValueCallback = validateValueCallback;
            this.IsReadOnly            = isReadOnly;
            this.Inherits              = metadata.Inherits;
            this.StringKey             = hashKey.StringKey;
            this.hashCode              = hashKey.GetHashCode();

            this.ownerMetadata = metadata;
            this.IsAttached    = isAttached;

            typeMetadata = new ConvertedStringDictionary <Type, PropertyMetadata>(type => type.FullName);
            typeMetadata.Add(OwnerType, ownerMetadata);

            typeMetadataCache = CacheDictionary <Type, PropertyMetadata> .CreateUsingStringKeys(ResolveTypeMetadata, type => type.FullName);

            typeContainsCache = CacheDictionary <Type, bool> .CreateUsingStringKeys(ResolveTypeContains, type => type.FullName);
        }
示例#2
0
 public override int GetHashCode()
 {
     return(hashKey.GetHashCode());
 }