Browse Source

Removing the optional "Extension" suffix from Markup Extension name if present.

pull/53/merge
gumme 12 years ago committed by Siegfried Pammer
parent
commit
a95cbc4a2e
  1. 11
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs

11
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs

@ -353,7 +353,16 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -353,7 +353,16 @@ namespace ICSharpCode.WpfDesign.XamlDom
internal string GetNameForMarkupExtension()
{
return XmlElement.Name;
string markupExtensionName = XmlElement.Name;
// By convention a markup extension class name typically includes an "Extension" suffix.
// When you reference the markup extension in XAML the "Extension" suffix is optional.
// If present remove it to avoid bloating the XAML.
if (markupExtensionName.EndsWith("Extension", StringComparison.Ordinal)) {
markupExtensionName = markupExtensionName.Substring(0, markupExtensionName.Length - 9);
}
return markupExtensionName;
}
}

Loading…
Cancel
Save