private static void ApplyAdornerCore(FrameworkElement element, Adorner adorner) { var layer = GetAdornerLayer(element); layer.Add(adorner); SetLayerZOrder(adorner, adorner.GetAdornerIndex()); }