internal static FrameworkElement AsToolHandle(FrameworkElement elt) { if (NodePanel.GetFigure(elt) != NodeFigure.None) { return(elt); } else { return(null); } }
internal static FrameworkElement FindToolHandle(DependencyObject v) { if (v == null || v is Part) { return(null); } if (NodePanel.GetFigure(v) != NodeFigure.None) { return(v as FrameworkElement); } return(FindToolHandle(System.Windows.Media.VisualTreeHelper.GetParent(v))); }