internal static void AddDragEnterHandler(DependencyObject element, CustomDragEventHandler handler, bool handledEventsToo)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     if (handler == null)
     {
         throw new ArgumentNullException("handler");
     }
     CustomExtendedRoutedEventHandlerCollection<CustomDragEventHandler, CustomDragEventArgs> dragEnterHandlers = element.GetDragEnterHandlers();
     CustomExtendedRoutedEventHandlerCollection<CustomDragEventHandler, CustomDragEventArgs> handlers2 = dragEnterHandlers ?? new CustomExtendedRoutedEventHandlerCollection<CustomDragEventHandler, CustomDragEventArgs>((h, a) => h(element, a));
     handlers2.Add(handler, handledEventsToo);
     if (handlers2 != dragEnterHandlers)
     {
         element.SetValue(DragEnterHandlerProperty, handlers2);
     }
 }
 internal static void RemoveDragEnterHandler(DependencyObject element, CustomDragEventHandler handler)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     if (handler == null)
     {
         throw new ArgumentNullException("handler");
     }
     CustomExtendedRoutedEventHandlerCollection<CustomDragEventHandler, CustomDragEventArgs> dragEnterHandlers = element.GetDragEnterHandlers();
     if (dragEnterHandlers != null)
     {
         dragEnterHandlers.Remove(handler);
     }
 }
        /// <summary>
        /// Adds a handler to the attached DragEnter event.
        /// </summary>
        /// <param name="element">The DependencyObject to attach an event handler for.</param>
        /// <param name="handler">The event handler.</param>
        /// <param name="handledEventsToo">A value Indicating whether to invoke the handler if the event is handled.</param>
        internal static void AddDragEnterHandler(DependencyObject element, DragEventHandler handler, bool handledEventsToo)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }
            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }

ExtendedRoutedEventHandlerCollection<DragEventHandler, DragEventArgs> originalHandlers = element.GetDragEnterHandlers();
            ExtendedRoutedEventHandlerCollection<DragEventHandler, DragEventArgs> handlers = originalHandlers ?? new ExtendedRoutedEventHandlerCollection<DragEventHandler, DragEventArgs>((h, a) => h(element, a)); 
            handlers.Add(handler, handledEventsToo);
            if (handlers != originalHandlers)
            {
                element.SetValue(DragEnterHandlerProperty, handlers);
            }
        }