diff --git a/src/DynamoCoreWpf/Extensions/ViewLoadedParams.cs b/src/DynamoCoreWpf/Extensions/ViewLoadedParams.cs index a24629a431b..4433a4a8790 100644 --- a/src/DynamoCoreWpf/Extensions/ViewLoadedParams.cs +++ b/src/DynamoCoreWpf/Extensions/ViewLoadedParams.cs @@ -83,6 +83,7 @@ internal ViewLoadedParams(DynamoView dynamoV, DynamoViewModel dynamoVM) : dynamoMenu = dynamoView.titleBar.ChildOfType(); ViewStartupParams = new ViewStartupParams(dynamoVM); DynamoSelection.Instance.Selection.CollectionChanged += OnSelectionCollectionChanged; + DynamoView.CloseExtension += OnViewExtensionClosed; } public void AddMenuItem(MenuBarType type, MenuItem menuItem, int index = -1) @@ -147,6 +148,18 @@ private void OnSelectionCollectionChanged(object sender, NotifyCollectionChanged } } + /// + /// Event raised when the view extension is closed. + /// + public event Action ViewExtensionClosed; + private void OnViewExtensionClosed(String extensionTabName) + { + if (ViewExtensionClosed != null) + { + ViewExtensionClosed(extensionTabName); + } + } + private void AddItemToMenu(MenuBarType type, Control itemToAdd, int index) { if (dynamoMenu == null) return;