Exemple #1
0
        public static BehaviorCollection GetBehaviors(DependencyObject obj)
        {
            var behaviors = obj.GetValue(BehaviorsProperty) as BehaviorCollection;

            if (behaviors == null)
            {
                behaviors = new BehaviorCollection();
                SetBehaviors(obj, behaviors);
            }

            return(behaviors);
        }
Exemple #2
0
 /// <summary>
 /// Called when Property is retrieved
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="value"></param>
 private static void SetBehaviors(DependencyObject obj, BehaviorCollection value)
 {
     obj.SetValue(BehaviorsProperty, value);
 }