The .NET Framework comes with a plethora of built-in controls that cover most real-world scenarios. And when we need something slightly different, we have seen that we can utilize the WPF styling and/or templating systems to adapt them to our requirements. However, there are also further ways of adjusting the built-in controls to suit our needs.
Each .NET control has a number of methods, each named with the prefix On, for example, OnInitialized or OnApplyTemplate. These are protected methods, that can be overridden in any custom class that extends a .NET control. They are called at certain points in the control's lifetime and enable us to change the default behavior of each control.
They enable us to do things as simple as starting a process as soon as a control has been initialized, or accessing a named control from a custom ControlTemplate...