Exemplo n.º 1
0
        public static BindingPropertyMatchInfo GetDefaultBindingPropertyInfo(SceneNode sceneNode, IType dataType)
        {
            BindingPropertyMatchInfo bestProperty = new BindingPropertyMatchInfo((IProperty)null);
            IProperty property = sceneNode.ProjectContext.ResolveProperty(BaseFrameworkElement.DataContextProperty);

            for (IType type = sceneNode.Type; type != null; type = type.BaseType)
            {
                ReferenceStep propertyInternal = BindingPropertyHelper.GetDefaultBindingPropertyInternal(type.NearestResolvedType, sceneNode.ProjectContext);
                if (propertyInternal != null && BindingPropertyHelper.IsPropertyBindable(sceneNode, new PropertyReference(propertyInternal), BindingPropertyHelper.BindingType.Target))
                {
                    BindingPropertyMatchInfo propertyMatchInfo = new BindingPropertyMatchInfo((IProperty)propertyInternal);
                    propertyMatchInfo.Compatibility = propertyInternal != property?BindingPropertyHelper.GetPropertyCompatibility(propertyMatchInfo, dataType, (ITypeResolver)sceneNode.ProjectContext) : BindingPropertyCompatibility.DataContext;

                    bestProperty = BindingPropertyHelper.GetBetterProperty(bestProperty, propertyMatchInfo);
                }
            }
            return(bestProperty);
        }
Exemplo n.º 2
0
 public static bool IsPropertyBindable(SceneNode sceneNode, PropertyReference propertyReference)
 {
     return(BindingPropertyHelper.IsPropertyBindable(sceneNode, propertyReference, BindingPropertyHelper.BindingType.Target));
 }
Exemplo n.º 3
0
 public static bool IsPropertyValidBindingSource(SceneNode sceneNode, ReferenceStep referenceStep)
 {
     return(BindingPropertyHelper.IsPropertyBindable(sceneNode, new PropertyReference(referenceStep), BindingPropertyHelper.BindingType.Source));
 }
Exemplo n.º 4
0
 public static bool IsPropertyBindable(SceneNode sceneNode, ReferenceStep referenceStep)
 {
     return(BindingPropertyHelper.IsPropertyBindable(sceneNode, new PropertyReference(referenceStep)));
 }