|
|
|
@ -93,8 +93,22 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml
@@ -93,8 +93,22 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml
|
|
|
|
|
var nameScope = _context.RootItem.Component as INameScope; |
|
|
|
|
nameScope = NameScope.GetNameScope((DependencyObject) _context.RootItem.Component); |
|
|
|
|
var fnd = nameScope.FindName(site.Name); |
|
|
|
|
if (fnd != null) |
|
|
|
|
site.Name = null; |
|
|
|
|
|
|
|
|
|
if (fnd != null) { |
|
|
|
|
string newNm = site.Name + "_Copy"; |
|
|
|
|
fnd = nameScope.FindName(newNm); |
|
|
|
|
if (fnd == null) |
|
|
|
|
site.Name = newNm; |
|
|
|
|
else { |
|
|
|
|
int i = 1; |
|
|
|
|
while (fnd != null) { |
|
|
|
|
newNm = site.Name + "_Copy" + i; |
|
|
|
|
fnd = nameScope.FindName(newNm); |
|
|
|
|
i++; |
|
|
|
|
} |
|
|
|
|
site.Name = newNm; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return site; |
|
|
|
|
} |
|
|
|
|