diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs index 0d31aabc6c..287f8833da 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs @@ -161,6 +161,13 @@ namespace ICSharpCode.WpfDesign for (int i = 0; i < _extensionServers.Length; i++) { if (_extensionServers[i] == server) { bool shouldApply = server.ShouldApplyExtensions(this); + + if (server.ShouldBeReApplied() && shouldApply && shouldApply == _extensionServerIsApplied[i]) + { + _extensionServerIsApplied[i] = false; + ApplyUnapplyExtensionServer(extensionManager, false, server); + } + if (shouldApply != _extensionServerIsApplied[i]) { _extensionServerIsApplied[i] = shouldApply; ApplyUnapplyExtensionServer(extensionManager, shouldApply, server); diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionServer.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionServer.cs index b7b5595dac..6628bb1607 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionServer.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionServer.cs @@ -74,6 +74,14 @@ namespace ICSharpCode.WpfDesign.Extensions /// public abstract bool ShouldApplyExtensions(DesignItem extendedItem); + // + /// Set if the Extension Server should be reaplied (For multiple Selection extension Server for Example!) + /// + public virtual bool ShouldBeReApplied() + { + return false; + } + /// /// Create an extension of the specified type. /// Is called by the ExtensionManager. diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs index fc88c441a9..3a9011716d 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs @@ -121,6 +121,11 @@ namespace ICSharpCode.WpfDesign.Extensions ReapplyExtensions(this.Services.Selection.SelectedItems); } + public override bool ShouldBeReApplied() + { + return true; + } + /// /// Gets if the item is in the secondary selection. ///