private object ParseAttributeMarkup (XamlObjectElement element, XamlPropertySetter property) { MarkupExpressionParser parser = new SL4MarkupExpressionParser (element.Object, property.Name, this, element); string expression = reader.Value; object o = parser.ParseExpression (ref expression); return o; }
private object ParseAttributeMarkup (XamlObjectElement element, XamlPropertySetter property, XamlAttribute ai) { MarkupExpressionParser parser = new SL4MarkupExpressionParser (element.Object, property.Name, this, element); string expression = ai.Value; object o = null; try { o = parser.ParseExpression (ref expression); } catch (Exception e) { throw ParseException ("Could not convert attribute value '{0}' on element {1} for property {2}.", ai.Value, element.Name, property.Name); } if (o == null && !MarkupExpressionParser.IsExplicitNull (expression)) throw ParseException ("Unable to convert attribute value: '{0}'.", ai.Value); return property.ConvertValue (property.Type, o); }