protected override bool IsControlElementCore() { // Return false if RibbonTwoLineText is part of a ControlTemplate, otherwise return the base method RibbonTwoLineText tlt = (RibbonTwoLineText)Owner; DependencyObject templatedParent = tlt.TemplatedParent; // If the templatedParent is a ContentPresenter, this RibbonTwoLineText is generated from a DataTemplate if (templatedParent == null || templatedParent is ContentPresenter) { return(base.IsControlElementCore()); } return(false); }
/// public RibbonTwoLineTextAutomationPeer(RibbonTwoLineText owner) : base(owner) { }