Пример #1
0
        private IProperty GetSpecialDefaultBindingProperty(DataBindingDragDropFlags filteredDragFlags)
        {
            DataSchemaNodePath primaryAbsolutePath    = this.DragModel.DataSource.PrimaryAbsolutePath;
            IProperty          defaultBindingProperty = this.GetDefaultBindingProperty(filteredDragFlags, primaryAbsolutePath);

            if (!DataContextMetadata.HasDataContextAttributes(defaultBindingProperty))
            {
                return((IProperty)null);
            }
            DataContextInfo dataContextInfo = new DataContextEvaluator().Evaluate(this.DragModel.TargetNode, (IPropertyId)defaultBindingProperty, true);

            if (dataContextInfo.DataSource.SourceNode != primaryAbsolutePath.Schema.DataSource.DocumentNode)
            {
                return((IProperty)null);
            }
            DataSchemaNodePath nodePathFromPath = primaryAbsolutePath.Schema.GetNodePathFromPath(dataContextInfo.DataSource.Path);

            if (!nodePathFromPath.IsSubpathOf(primaryAbsolutePath))
            {
                return((IProperty)null);
            }
            DataSchemaNodePath relativeNodePath = nodePathFromPath.GetRelativeNodePath(primaryAbsolutePath);

            if (relativeNodePath.CollectionDepth != 0)
            {
                return((IProperty)null);
            }
            this.DragModel.TargetPropertySpecialDataContext = relativeNodePath;
            return(defaultBindingProperty);
        }