/// <summary>
        /// Create a <see cref="ContentDragAdorner"/> that renders a <see cref="ContentPresenter"/> with Content, ContentTemplate and ContentTemplateSelector from <paramref name="adornedElement"/>.
        /// </summary>
        /// <param name="adornedElement">The drag source.</param>
        /// <returns>
        /// A <see cref="ContentDragAdorner"/> that should be disposed when the drag operation ends.
        /// Disposing it removes subscriptions and removes the adorner.
        /// </returns>
        public static ContentDragAdorner Create(ContentPresenter adornedElement)
        {
            var adorner = new ContentDragAdorner(adornedElement)
            {
                Content                 = adornedElement.Content,
                ContentTemplate         = adornedElement.ContentTemplate,
                ContentTemplateSelector = adornedElement.ContentTemplateSelector,
            };

            AdornerService.Show(adorner);
            return(adorner);
        }
        /// <summary>
        /// Create a <see cref="ContentDragAdorner"/> that renders a <see cref="ContentPresenter"/> with Content, ContentTemplate and ContentTemplateSelector from <paramref name="adornedElement"/>.
        /// </summary>
        /// <param name="adornedElement">The drag source.</param>
        /// <returns>
        /// A <see cref="ContentDragAdorner"/> that should be disposed when the drag operation ends.
        /// Disposing it removes subscriptions and removes the adorner.
        /// </returns>
        public static ContentDragAdorner Create(ContentPresenter adornedElement)
        {
            if (adornedElement is null)
            {
                throw new ArgumentNullException(nameof(adornedElement));
            }

            var adorner = new ContentDragAdorner(adornedElement)
            {
                Content                 = adornedElement.Content,
                ContentTemplate         = adornedElement.ContentTemplate,
                ContentTemplateSelector = adornedElement.ContentTemplateSelector,
            };

            AdornerService.Show(adorner);
            return(adorner);
        }
        /// <summary>
        /// Create a <see cref="ContentDragAdorner"/> that renders a <see cref="ContentPresenter"/>.
        /// The adorner is added to the adorner layer before it is returned.
        /// </summary>
        /// <param name="adornedElement">The drag source.</param>
        /// <param name="content">The content to drag.</param>
        /// <param name="contentTemplate">The template for the dragged content.</param>
        /// <param name="contentTemplateSelector">The template selector for the dragged content.</param>
        /// <returns>
        /// A <see cref="ContentDragAdorner"/> that should be disposed when the drag operation ends.
        /// Disposing it removes subscriptions and removes the adorner.
        /// </returns>
        public static ContentDragAdorner Create(
            UIElement adornedElement,
            object content,
            DataTemplate contentTemplate = null,
            DataTemplateSelector contentTemplateSelector = null)
        {
            var adorner = new ContentDragAdorner(adornedElement)
            {
                Content = content,
            };

            if (contentTemplate != null)
            {
                adorner.ContentTemplate = contentTemplate;
            }

            if (contentTemplateSelector != null)
            {
                adorner.ContentTemplateSelector = contentTemplateSelector;
            }

            AdornerService.Show(adorner);
            return(adorner);
        }