Exemplo n.º 1
0
 public static DependencyProperty RegisterAttached(string name, Type propertyType,
                                                   Type ownerType, PropertyMetadata defaultMetadata)
 {
     return(RegisterCommon(name, propertyType, ownerType, defaultMetadata));
 }
Exemplo n.º 2
0
        private static DependencyProperty RegisterCommon(string name, Type propertyType,
                                                         Type ownerType, PropertyMetadata propertyMetadata)
        {
            ValidateParams(name, propertyType, ownerType);

            // Force native type registration, but skip DP registration because we are inside
            // static constructor and DP are already being registered
            IntPtr ownerTypePtr = Noesis.Extend.EnsureNativeType(ownerType, false);

            // Check property type is supported and get the registered native type
            Type   originalPropertyType = propertyType;
            IntPtr nativeType           = ValidatePropertyType(ref propertyType);

            // Create and register dependency property
            IntPtr dependencyPtr = Noesis_RegisterDependencyProperty(ownerTypePtr,
                                                                     name, nativeType, PropertyMetadata.getCPtr(propertyMetadata).Handle);

            DependencyProperty dependencyProperty = new DependencyProperty(dependencyPtr, false);

            dependencyProperty.OriginalPropertyType = originalPropertyType;

            RegisterCalled = true;
            return(dependencyProperty);
        }
Exemplo n.º 3
0
 public static DependencyProperty Register(string name, Type propertyType,
                                           Type ownerType, PropertyMetadata typeMetadata)
 {
     return(RegisterCommon(name, propertyType, ownerType, typeMetadata));
 }