|
|
@ -1089,13 +1089,20 @@ namespace Ricciolo.StylesExplorer.MarkupReflection |
|
|
|
complexPropertyOpened--; |
|
|
|
complexPropertyOpened--; |
|
|
|
// this property could be a markup extension
|
|
|
|
// this property could be a markup extension
|
|
|
|
// try to convert it
|
|
|
|
// try to convert it
|
|
|
|
|
|
|
|
int elementIndex = nodes.IndexOf(propertyElement.Parent); |
|
|
|
int start = nodes.IndexOf(propertyElement) + 1; |
|
|
|
int start = nodes.IndexOf(propertyElement) + 1; |
|
|
|
IEnumerator<XmlBamlNode> enumerator = nodes.GetEnumerator(); |
|
|
|
IEnumerator<XmlBamlNode> enumerator = nodes.GetEnumerator(); |
|
|
|
|
|
|
|
|
|
|
|
// move enumerator to the start of this property value
|
|
|
|
// move enumerator to the start of this property value
|
|
|
|
for (int i = 0; i < start && enumerator.MoveNext(); i++) ; |
|
|
|
// note whether there are any child elements before this one
|
|
|
|
|
|
|
|
bool anyChildElement = false; |
|
|
|
|
|
|
|
for (int i = 0; i < start && enumerator.MoveNext(); i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (i > elementIndex && i < start - 1 && (enumerator.Current is XmlBamlEndElement)) |
|
|
|
|
|
|
|
anyChildElement = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (IsExtension(enumerator) && start < nodes.Count - 1) { |
|
|
|
if (!anyChildElement && IsExtension(enumerator) && start < nodes.Count - 1) { |
|
|
|
start--; |
|
|
|
start--; |
|
|
|
nodes.RemoveAt(start); |
|
|
|
nodes.RemoveAt(start); |
|
|
|
nodes.RemoveLast(); |
|
|
|
nodes.RemoveLast(); |
|
|
|