From ee7d9e8424294575ef8ce8f52240fb306fd90e62 Mon Sep 17 00:00:00 2001 From: reddyashish <43763136+reddyashish@users.noreply.github.com> Date: Thu, 12 Nov 2020 00:57:45 -0500 Subject: [PATCH] Public event for view extensions indicating a close action on the sidebar. --- src/DynamoCoreWpf/Extensions/ViewLoadedParams.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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;