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); }
public static bool IsPropertyBindable(SceneNode sceneNode, PropertyReference propertyReference) { return(BindingPropertyHelper.IsPropertyBindable(sceneNode, propertyReference, BindingPropertyHelper.BindingType.Target)); }
public static bool IsPropertyValidBindingSource(SceneNode sceneNode, ReferenceStep referenceStep) { return(BindingPropertyHelper.IsPropertyBindable(sceneNode, new PropertyReference(referenceStep), BindingPropertyHelper.BindingType.Source)); }
public static bool IsPropertyBindable(SceneNode sceneNode, ReferenceStep referenceStep) { return(BindingPropertyHelper.IsPropertyBindable(sceneNode, new PropertyReference(referenceStep))); }