diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs index b540256d05..c09fcd5697 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs @@ -139,7 +139,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions void CreateSurface(PlacementOperation operation) { - if (ExtendedItem.Services.DesignPanel != null) { + if (ExtendedItem.Services.GetService() != null) { surface = new Canvas(); adornerPanel = new AdornerPanel(); diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs index 148a493439..6510a9a971 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs @@ -125,7 +125,7 @@ namespace ICSharpCode.WpfDesign.XamlDom XmlElement newElement = e.OwnerDocument.CreateElement(prefix, e.Name, e.NamespaceURI); foreach (XmlAttribute a in target.Attributes) { - if (a.Prefix == "xmlns") { + if (a.Prefix == "xmlns" || a.Name == "xmlns") { newElement.Attributes.Append(a.Clone() as XmlAttribute); } } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/ServiceContainer.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/ServiceContainer.cs index 928567c8ec..6e758bb2c4 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/ServiceContainer.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/ServiceContainer.cs @@ -56,6 +56,7 @@ namespace ICSharpCode.WpfDesign /// /// Gets the service object of the specified type. + /// Returns null when the service is not available. /// public object GetService(Type serviceType) { @@ -66,6 +67,7 @@ namespace ICSharpCode.WpfDesign /// /// Gets the service object of the type T. + /// Returns null when the service is not available. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")] public T GetService() where T : class