Dynamo: Looking for a way to handle a user clicking (x) to close a sidebar extension

Created on 26 Aug 2020  Β·  10Comments  Β·  Source: DynamoDS/Dynamo

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, https://github.com/DynamoDS/Dynamo/blob/fd18ceb31a3b3012bd577dd7c15a8d4c2158432e/src/WorkspaceDependencyViewExtension/WorkspaceDependencyView.xaml.cs#L180

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. 🀦 https://github.com/DynamoDS/Dynamo/blob/0a72ece74a4f3a0fc2040daa225433ad86dab9d4/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs#L80

developer experience

All 10 comments

@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.

😁

Funny enough this is for thesaurus.
thesaurus-sidebarMode

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?

@mmisol - @QilongTang worked on this! Feel free to reach out internally πŸ˜„

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.

That’s the goal! πŸ™‚

On Thu, Aug 27, 2020 at 8:28 AM Sol Amour notifications@github.com wrote:

>
>
>

Hi @johnpierson https://github.com/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 https://github.com/QilongTang.

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/DynamoDS/Dynamo/issues/11060#issuecomment-681984588,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ADYD5VFLKITUMPVM3BDLK43SCZURHANCNFSM4QMIVY2Q
.

@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?

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

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;
        }

Glad to hear it @johnpierson !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

erfajo picture erfajo  Β·  3Comments

DrLicor picture DrLicor  Β·  4Comments

askgrkumar picture askgrkumar  Β·  4Comments

mccrone picture mccrone  Β·  8Comments

dbaldacchino picture dbaldacchino  Β·  7Comments