예제 #1
0
        private RawDataSourceInfoBase GetBindingAsDataSource(DataBindingProcessingContext context)
        {
            RawDataSourceInfoBase sourceInfoFromBinding = DataContextHelper.GetDataSourceInfoFromBinding(context.DocumentCompositeNode);
            RawDataSourceInfoBase dataSourceInfoBase    = this.CombineDataSources(context.DataContext, sourceInfoFromBinding);

            if (!dataSourceInfoBase.IsValid)
            {
                dataSourceInfoBase = this.GetRelativeSourceTargetBindingDataSource(context);
            }
            return(dataSourceInfoBase);
        }
예제 #2
0
        private void ProcessChangePropertyAction(DataBindingProcessingContext context)
        {
            INodeSourceContext    containerContext = (INodeSourceContext)null;
            DocumentCompositeNode bindingNode      = context.DocumentCompositeNode.GetValue(DataBindingProcessor.ChangePropetyActionTargetObject, out containerContext) as DocumentCompositeNode;

            if (bindingNode == null || !bindingNode.Type.IsBinding)
            {
                return;
            }
            RawDataSourceInfoBase sourceInfoFromBinding = DataContextHelper.GetDataSourceInfoFromBinding(bindingNode);
            RawDataSourceInfoBase bindingInfo           = this.CombineDataSources(context.DataContext, sourceInfoFromBinding);

            if (!bindingInfo.IsValid)
            {
                bindingInfo = this.GetRelativeSourceTargetBindingDataSource(context);
            }
            if (bindingInfo == null || !bindingInfo.IsValid)
            {
                return;
            }
            this.HandleBinding(context, bindingInfo);
        }
예제 #3
0
 public static RawDataSourceInfoBase GetRawDataSourceInfo(DocumentNode dataSourceNode)
 {
     return(!dataSourceNode.Type.IsBinding ? (!dataSourceNode.Type.IsResource ? (RawDataSourceInfoBase) new RawDataSourceInfo(dataSourceNode, (string)null) : DataContextHelper.GetDataSourceInfoFromResourceReference((DocumentCompositeNode)dataSourceNode)) : DataContextHelper.GetDataSourceInfoFromBinding((DocumentCompositeNode)dataSourceNode));
 }
예제 #4
0
 private static IType GetBindingType(DocumentCompositeNode bindingNode)
 {
     return(DataContextHelper.GetTypeFromDataSource(DataContextHelper.GetDataSourceInfoFromBinding(bindingNode)));
 }