Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looking for a way to handle a user clicking (x) to close a sidebar extension #11060

Closed
johnpierson opened this issue Aug 26, 2020 · 10 comments
Closed
Labels
developer experience more high-level issues that are more specific to individuals actively developing on Dynamo.

Comments

@johnpierson
Copy link
Member

Dynamo version

Dynamo 2.6.1

Operating system

Windows 10

What did you do?

Trying to implement a handler that unchecks a menu item when a sidebar view extension is closed. Kind of like this,

DynamoView.CloseExtension += this.OnExtensionTabClosedHandler;

What did you expect to see?

The ability to subscribe to its closing event to uncheck it.

What did you see instead?

It is internal. 🤦

internal static event Action<String> CloseExtension;

@QilongTang
Copy link
Contributor

@johnpierson I know this is going to come up at some time :) I still need to confirm with @Amoursol that we would like to encourage 3rd party extensions to be able to add Dynamo menu items. If that is the case, we can expose this event to unblock you.

@johnpierson
Copy link
Member Author

😁

Funny enough this is for thesaurus.
thesaurus-sidebarMode

@mmisol
Copy link
Collaborator

mmisol commented Aug 27, 2020

Hi @johnpierson . Just chiming in to say that thesaurus looks very intriguing. Is that some sort ML driven tool to suggest nodes related to the ones you add?

@Amoursol
Copy link
Contributor

@mmisol - @QilongTang worked on this! Feel free to reach out internally 😄

@Amoursol
Copy link
Contributor

Hi @johnpierson!

Are you looking to simply have a tick removed from a menu item when that same extension is closed in the sidebar panel? If so, I'm 💯 on board with opening that up @QilongTang.

@johnpierson
Copy link
Member Author

johnpierson commented Aug 27, 2020 via email

@Amoursol Amoursol added the developer experience more high-level issues that are more specific to individuals actively developing on Dynamo. label Aug 27, 2020
@QilongTang
Copy link
Contributor

@Amoursol This should be small effort given just making the event public. Do you want to make it available in Dynamo 2.8 given it will probably gain popularity?

@Amoursol
Copy link
Contributor

Amoursol commented Sep 2, 2020

@QilongTang if you have time to squeeze this in, then yes please.

@johnpierson
Copy link
Member Author

johnpierson commented Sep 3, 2020

I actually think I can work around this using OnUnloaded on the user control.

Here is how I am handling it in SimpleSearch right now,

 // establish the simple search view (user control)
            SimpleSearch.SimpleSearch ss = new SimpleSearch.SimpleSearch(p);
            ss.Unloaded += SsOnUnloaded;
private void SsOnUnloaded(object sender, RoutedEventArgs e)
        {
            this._simpleSearchMenuItem.IsChecked = false;
        }

@Amoursol
Copy link
Contributor

Amoursol commented Sep 8, 2020

Glad to hear it @johnpierson !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer experience more high-level issues that are more specific to individuals actively developing on Dynamo.
Projects
None yet
Development

No branches or pull requests

4 participants