Browse Source

Fix Exception in XamlDesigner

pull/692/head
jkuehner 10 years ago
parent
commit
a2f8ecf3fc
  1. 3
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs

3
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs

@ -248,8 +248,9 @@ namespace ICSharpCode.WpfDesign.XamlDom
try { try {
ValueOnInstance = PropertyValue.GetValueFor(propertyInfo); ValueOnInstance = PropertyValue.GetValueFor(propertyInfo);
if (this.parentObject.XamlSetTypeConverter != null) if (this.parentObject.XamlSetTypeConverter != null && propertyValue is XamlTextValue) {
this.ParentObject.XamlSetTypeConverter(this.parentObject.Instance, new XamlSetTypeConverterEventArgs(this.SystemXamlMemberForProperty, null, ((XamlTextValue) propertyValue).Text, this.parentObject.OwnerDocument.GetTypeDescriptorContext(this.parentObject), null)); this.ParentObject.XamlSetTypeConverter(this.parentObject.Instance, new XamlSetTypeConverterEventArgs(this.SystemXamlMemberForProperty, null, ((XamlTextValue) propertyValue).Text, this.parentObject.OwnerDocument.GetTypeDescriptorContext(this.parentObject), null));
}
if (propertyInfo.DependencyProperty == DesignTimeProperties.DesignWidthProperty) { if (propertyInfo.DependencyProperty == DesignTimeProperties.DesignWidthProperty) {
var widthProperty = this.ParentObject.Properties.FirstOrDefault(x => x.DependencyProperty == FrameworkElement.WidthProperty); var widthProperty = this.ParentObject.Properties.FirstOrDefault(x => x.DependencyProperty == FrameworkElement.WidthProperty);

Loading…
Cancel
Save