bool TryToHandleDProperty(Assignment context) { var attributeName = context.Name; var attributeValue = context.Value; // BOA.UI.EditorBase.LabelWidthProperty if (attributeName.Contains('.')) // dependency property { var dp = BuilderUtility.SearchDependencyProperty(attributeName, TypeFinder); if (dp == null) { throw Errors.DependencyPropertyNotFound(attributeName); } attributeValue = BuilderUtility.NormalizeValueForType(attributeValue, dp.PropertyType); View.SetValue(dp, attributeValue); return(true); } return(false); }
public void SearchDependencyProperty() { Assert.IsNotNull(BuilderUtility.SearchDependencyProperty("System.Windows.FrameworkElement.WidthProperty", new TypeFinder())); Assert.IsNotNull(BuilderUtility.SearchDependencyProperty(this.GetType().FullName + ".TestPropertyNullableInt32Property", new TypeFinder())); }