OnTemplateChanged() protected method

Provides derived classes an opportunity to handle changes to the Template property.
protected OnTemplateChanged ( System.Windows.Controls.ControlTemplate oldTemplate, System.Windows.Controls.ControlTemplate newTemplate ) : void
oldTemplate System.Windows.Controls.ControlTemplate
newTemplate System.Windows.Controls.ControlTemplate
return void
Example #1
0
        /// <summary>
        /// Handles changes to the Template property.
        /// </summary>
        private static void OnTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SelectionAdorner target      = (SelectionAdorner)d;
            ControlTemplate  oldTemplate = (ControlTemplate)e.OldValue;
            ControlTemplate  newTemplate = target.Template;

            target.OnTemplateChanged(oldTemplate, newTemplate);
        }