public static DependencyPropertyReferenceStep GetReferenceStep(ITypeResolver typeResolver, Type targetType, object dependencyProperty, Type declaringType, string propertyName, Microsoft.Expression.DesignModel.Metadata.MemberType memberTypes)
        {
            if (typeof(IDesignTimePropertyImplementor).IsAssignableFrom(declaringType))
            {
                IPropertyId propertyId = DesignTimeProperties.FromName(propertyName, (Microsoft.Expression.DesignModel.Metadata.PlatformTypes)typeResolver.PlatformMetadata, null);
                return(propertyId as DependencyPropertyReferenceStep);
            }
            Microsoft.Expression.DesignModel.Metadata.PlatformTypes platformMetadata = (Microsoft.Expression.DesignModel.Metadata.PlatformTypes)typeResolver.PlatformMetadata;
            DependencyPropertyReferenceStep property = platformMetadata.GetProperty(typeResolver, targetType, memberTypes, propertyName) as DependencyPropertyReferenceStep;

            if (property != null && property.DependencyProperty == dependencyProperty)
            {
                return(property);
            }
            if (!declaringType.IsAssignableFrom(targetType))
            {
                if (TypeHelper.IsSet(memberTypes, Microsoft.Expression.DesignModel.Metadata.MemberType.AttachedProperty))
                {
                    DependencyPropertyReferenceStep dependencyPropertyReferenceStep = platformMetadata.GetProperty(typeResolver, declaringType, Microsoft.Expression.DesignModel.Metadata.MemberType.AttachedProperty, propertyName) as DependencyPropertyReferenceStep;
                    property = dependencyPropertyReferenceStep;
                    if (dependencyPropertyReferenceStep == null)
                    {
                        goto Label1;
                    }
                    if (property.TargetType.IsAssignableFrom(targetType))
                    {
                        return(property);
                    }
                    else
                    {
                        return(null);
                    }
                }
Label1:
                if (TypeHelper.IsSet(memberTypes, Microsoft.Expression.DesignModel.Metadata.MemberType.DependencyProperty))
                {
                    DependencyPropertyReferenceStep property1 = platformMetadata.GetProperty(typeResolver, declaringType, Microsoft.Expression.DesignModel.Metadata.MemberType.DependencyProperty, propertyName) as DependencyPropertyReferenceStep;
                    property = property1;
                    if (property1 != null)
                    {
                        return(property);
                    }
                }
            }
            return(null);
        }
        public static IProperty GetProperty(ITypeResolver typeResolver, Type targetType, PropertyDescriptor propertyDescriptor)
        {
            if (typeResolver.IsCapabilitySet(PlatformCapability.UseDependencyPropertyDescriptor))
            {
                DependencyPropertyDescriptor propertyDescriptor1 = DependencyPropertyDescriptor.FromProperty(propertyDescriptor);
                if (propertyDescriptor1 != null)
                {
                    return((IProperty)DependencyPropertyReferenceStep.GetReferenceStep(typeResolver, targetType, propertyDescriptor1.DependencyProperty));
                }
            }
            IType type = typeResolver.GetType(targetType);

            if (typeResolver.PlatformMetadata.IsNullType((ITypeId)type))
            {
                return((IProperty)null);
            }
            MemberAccessTypes allowableMemberAccess = TypeHelper.GetAllowableMemberAccess(typeResolver, type);

            return(type.GetMember(MemberType.Property, propertyDescriptor.Name, allowableMemberAccess) as IProperty);
        }
 public static DependencyPropertyReferenceStep GetReferenceStep(ITypeResolver typeResolver, Type targetType, DependencyPropertyReferenceStep referenceStep, Microsoft.Expression.DesignModel.Metadata.MemberType memberTypes)
 {
     return(DependencyPropertyReferenceStep.GetReferenceStep(typeResolver, targetType, referenceStep.DependencyProperty, PlatformTypeHelper.GetDeclaringType(referenceStep), referenceStep.Name, memberTypes));
 }
 public static DependencyPropertyReferenceStep GetReferenceStep(ITypeResolver typeResolver, Type targetType, DependencyPropertyReferenceStep referenceStep)
 {
     return(DependencyPropertyReferenceStep.GetReferenceStep(typeResolver, targetType, referenceStep, Microsoft.Expression.DesignModel.Metadata.MemberType.Property));
 }
 public static DependencyPropertyReferenceStep GetReferenceStep(ITypeResolver typeResolver, Type targetType, System.Windows.DependencyProperty dependencyProperty, Microsoft.Expression.DesignModel.Metadata.MemberType memberTypes)
 {
     return(DependencyPropertyReferenceStep.GetReferenceStep(typeResolver, targetType, dependencyProperty, dependencyProperty.OwnerType, dependencyProperty.Name, Microsoft.Expression.DesignModel.Metadata.MemberType.Property));
 }
        public static void SetName(object target, string name, IPlatformMetadata platformMetadata)
        {
            DependencyPropertyReferenceStep dependencyPropertyReferenceStep = DesignTimeProperties.ResolveDesignTimeReferenceStep(DesignTimeProperties.XNameProperty, platformMetadata);

            dependencyPropertyReferenceStep.SetValue(target, name);
        }
        public static string GetName(object target, IPlatformMetadata platformMetadata)
        {
            DependencyPropertyReferenceStep dependencyPropertyReferenceStep = DesignTimeProperties.ResolveDesignTimeReferenceStep(DesignTimeProperties.XNameProperty, platformMetadata);

            return((string)dependencyPropertyReferenceStep.GetValue(target));
        }