/// <summary>
        /// Getter for <see cref="AttachedVisualsProperty"/>
        /// </summary>
        public static VisualAttachmentCollection <IAttachable> GetAttachedVisuals(DependencyObject obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            var collection = (VisualAttachmentCollection <IAttachable>)obj.GetValue(AttachedVisualsProperty);

            // If the collection wasn't yet set
            if (collection == null)
            {
                // Create a new instance
                collection = new VisualAttachmentCollection <IAttachable>();

                // And set it for the object
                obj.SetValue(AttachedVisualsProperty, collection);

                if (obj is FrameworkElement element)
                {
                    // Subscribe to loaded and unloaded events
                    element.Loaded   -= FrameworkElementLoaded;
                    element.Loaded   += FrameworkElementLoaded;
                    element.Unloaded -= FrameworkElementUnloaded;
                    element.Unloaded += FrameworkElementUnloaded;
                }
            }

            return(collection);
        }
        /// <summary>
        /// Setter for <see cref="AttachedVisualsProperty"/>
        /// </summary>
        public static void SetAttachedVisuals(DependencyObject obj, VisualAttachmentCollection <IAttachable> value)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            obj.SetValue(AttachedVisualsProperty, value);
        }