Browse Source

Merge pull request #614 from jogibear9988/master

Bugfix Exception when Deleting Objects ...
pull/618/head
Siegfried Pammer 11 years ago
parent
commit
a84b9965ab
  1. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs

@ -96,6 +96,7 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml @@ -96,6 +96,7 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml
/// <param name="newName"></param>
public void FixDesignItemReferencesOnNameChange(string oldName, string newName)
{
if (!string.IsNullOrEmpty(oldName) && !string.IsNullOrEmpty(newName)) {
var root = GetRootXamlObject(this.XamlObject);
var references = GetAllChildXamlObjects(root).Where(x => x.ElementType == typeof(Reference) && Equals(x.FindOrCreateProperty("Name").ValueOnInstance, oldName));
foreach (var designItem in references)
@ -116,6 +117,7 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml @@ -116,6 +117,7 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml
property.PropertyValue = propertyValue;
}
}
}
/// <summary>
/// Find's the Root XamlObject (real Root, or Root Object in Namescope)

Loading…
Cancel
Save