protected virtual void HandleDataSourceAttribute(string dataSource, string additionalDataSource = null) { var dataSourceObject = new XmlElementDataSource(dataSource, currentXmlElement); // remove any pre-existing entries (as the dataSource string may have changed) currentXmlLayoutInstance.ElementDataSources.RemoveAll(ed => ed.XmlElement == currentXmlElement); if (string.IsNullOrEmpty(dataSource)) { return; } currentXmlLayoutInstance.ElementDataSources.Add(dataSourceObject); if (dataSourceObject.BindingType == ViewModelBindingType.TwoWay) { EnableTwoWayBinding(dataSource); } if (!currentXmlLayoutInstance.rebuildInProgress) { if (currentXmlLayoutInstance.XmlLayoutController != null && currentXmlLayoutInstance.XmlLayoutController is XmlLayoutControllerMVVM) { ((XmlLayoutControllerMVVM)currentXmlLayoutInstance.XmlLayoutController).ViewModelMemberChanged(dataSource); } } }
protected virtual void HandleDataSourceAttribute(string dataSource, string additionalDataSource = null) { var dataSourceObject = new XmlElementDataSource(dataSource, currentXmlElement); // remove any pre-existing entries (as the dataSource string may have changed) currentXmlLayoutInstance.ElementDataSources.RemoveAll(ed => ed.XmlElement == currentXmlElement); currentXmlLayoutInstance.ElementDataSources.Add(dataSourceObject); if (dataSourceObject.BindingType == ViewModelBindingType.TwoWay) { EnableGenericTwoWayBinding(dataSource); } }