#89 – Using Visual Studio to Follow the Inheritance Chain for WPF Types
October 9, 2010 Leave a comment
The inheritance chain for WPF classes is pretty deep. The Button class, for example, inherits from ButtonBase, and then from ContentControl, Control, FrameworkElement, etc.
You can look classes up in the MSDN documentation to find out which classes a particular class inherits from and which properties and methods it inherits. Or you can use the Go To Definition feature in Visual Studio 2010 to follow the chain.
Assume you have some code that mentions the Button class. You can right-click on the word “Button” and select Go To Definition.
You’ll see the metadata for Button and that it inherits from ButtonBase.
To follow the chain, right-click on ButtonBase and select Go To Definition again.
Again, a metadata window comes up, this time showing you the metadata for the ButtonBase class–and the fact that ButtonBase inherits from ContentControl.
The containing DLL is also listed at the top of the window.