Esempio n. 1
0
        public static DependencyProperty GetServiceProperty(IPropertySubject interactivityObject)
        {
            var propertyKind = interactivityObject.PropertyKind;
            var isResolved   = (propertyKind & PropertyKind.Resolved) != 0;

            propertyKind &= PropertyKind.Unspecified;

            if (propertyKind == PropertyKind.Unspecified)
            {
                return(null);
            }

            if (propertyKind == PropertyKind.Explicit)
            {
                return((DependencyProperty)interactivityObject.PropertyStore);
            }

            if (propertyKind == PropertyKind.Expando)
            {
                if (isResolved)
                {
                    return((DependencyProperty)interactivityObject.PropertyStore);
                }

                var resolvedProperty = DependencyPropertyManager.GetExpandoProperty((string)interactivityObject.PropertyStore);

                interactivityObject.PropertyStore = resolvedProperty;
                interactivityObject.PropertyKind |= PropertyKind.Resolved;

                return(resolvedProperty);
            }

            var propertyName = interactivityObject.PropertyStore as string ?? ((DependencyProperty)interactivityObject.PropertyStore).GetName();

            return(DependencyPropertyProxyManager.GetDependencyProperty(propertyName));
        }
Esempio n. 2
0
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 {
     return(DependencyPropertyProxyManager.GetDependencyProperty((string)value));
 }