Events for Dockable WPF Panels


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,


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

Perfect! Thanks so much Dale.

Hi @dale ,

I found this sample, but I cannot see this in the sample.
Am I using the right one?


I’ve updated the code sample - please pull the source and review.

– Dale