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); }
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); }
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)); }
private static IType GetBindingType(DocumentCompositeNode bindingNode) { return(DataContextHelper.GetTypeFromDataSource(DataContextHelper.GetDataSourceInfoFromBinding(bindingNode))); }