/// <summary>
        /// Provides a secure method for setting the Behaviors property.
        /// This dependency property indicates ....
        /// </summary>
        private static void SetBehaviors(DependencyObject d, BehaviorBindingCollection value)
        {
            d.SetValue(BehaviorsPropertyKey, value);
            INotifyCollectionChanged collection = value;

            collection.CollectionChanged += CollectionChanged;
        }
        /// <summary>
        /// Gets the Behaviors property.
        /// Here we initialze the collection and set the Owner property
        /// </summary>
        public static BehaviorBindingCollection GetBehaviors(DependencyObject d)
        {
            if (d == null)
            {
                throw new InvalidOperationException("The dependency object trying to attach to is set to null");
            }

            var collection = d.GetValue(BehaviorsProperty) as BehaviorBindingCollection;

            if (collection == null)
            {
                collection = new BehaviorBindingCollection {
                    Owner = d
                };
                SetBehaviors(d, collection);
            }
            return(collection);
        }