Esempio n. 1
0
        protected override void OnTemplateChanged(ControlTemplate oldTemplate, ControlTemplate newTemplate)
        {
            base.OnTemplateChanged(oldTemplate, newTemplate);

            if ((oldTemplate != null) && (_partContentPresenter != null))
            {
                RibbonHelper.ClearPseudoInheritedProperties(_partContentPresenter);
                _partContentPresenter = null;
            }
        }
        protected override void OnTemplateChanged(DataTemplate oldTemplate, DataTemplate newTemplate)
        {
            base.OnTemplateChanged(oldTemplate, newTemplate);

            if (oldTemplate != null)
            {
                RibbonHelper.ClearPseudoInheritedProperties(_templateRoot);
                if (_templateRoot != null)
                {
                    // Clearing the Ribbon property value which was set earlier.
                    _templateRoot.ClearValue(RibbonControlService.RibbonPropertyKey);
                }
                _templateRoot = null;
            }
        }
        protected override void ClearContainerForItemOverride(DependencyObject element, object item)
        {
            base.ClearContainerForItemOverride(element, item);

            RibbonHelper.ClearPseudoInheritedProperties(element);
        }