Skip to content

Commit

Permalink
Public event for view extensions indicating a close action on the sid…
Browse files Browse the repository at this point in the history
…ebar.
  • Loading branch information
reddyashish committed Nov 12, 2020
1 parent f00b2f7 commit ee7d9e8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/DynamoCoreWpf/Extensions/ViewLoadedParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ internal ViewLoadedParams(DynamoView dynamoV, DynamoViewModel dynamoVM) :
dynamoMenu = dynamoView.titleBar.ChildOfType<Menu>();
ViewStartupParams = new ViewStartupParams(dynamoVM);
DynamoSelection.Instance.Selection.CollectionChanged += OnSelectionCollectionChanged;
DynamoView.CloseExtension += OnViewExtensionClosed;
}

public void AddMenuItem(MenuBarType type, MenuItem menuItem, int index = -1)
Expand Down Expand Up @@ -147,6 +148,18 @@ private void OnSelectionCollectionChanged(object sender, NotifyCollectionChanged
}
}

/// <summary>
/// Event raised when the view extension is closed.
/// </summary>
public event Action<String> ViewExtensionClosed;
private void OnViewExtensionClosed(String extensionTabName)
{
if (ViewExtensionClosed != null)
{
ViewExtensionClosed(extensionTabName);
}
}

private void AddItemToMenu(MenuBarType type, Control itemToAdd, int index)
{
if (dynamoMenu == null) return;
Expand Down

0 comments on commit ee7d9e8

Please sign in to comment.