Events for Dockable WPF Panels


#1

Hello-

I was looking for guidance for best practices in adding and removing methods to event handlers in a dockable WPF panel. My project is based off of Dale’s sample wpf panel project.

I have a properties panel in my plug-in that looks for currently selected objects and returns various values. It’s easy enough to add methods when the user control initializes, but what I’d like to do is ensure that it’s only listening for selection changes when the panel is visible. Any recommendations as to where best locate the add/remove methods to the event handlers to achieve this?

thanks in advance,

Dave


Dockable WPF Panels (preferably Python)
(Dale Fugier) #2

Hi Dave,

A WPF UserControl has an IsVisibleChanged event that will let you know when window’s visibility has changed.

I’ve modified the sample, you’ve referenced, to demonstrate how to use this.

– Dale


#3

Perfect! Thanks so much Dale.