WPF Register SelectionChanged Event

Hi @MelleH,

You’re right about using the SelectionChanged event.

You just need to create a function (or a method of your panel class) with a single input argument, that will be of SelectionChangedEventArgs type, from which you can access the selection.

Then, you have to register that method during your panel initialization

HOST_APP.uiapp.SelectionChanged += my_function_name

And remember to remove the handler when you close the panel

HOST_APP.uiapp.SelectionChanged -= my_function_name

This is the theory, I don’t know If IronPython is fine with this, never tried it myself :sweat_smile:

3 Likes