Ejemplo n.º 1
0
        /// <summary>
        /// Gets the or create behavior.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <returns></returns>
        private static MouseDownBehavior GetOrCreateBehavior(RibbonTab element)
        {
            MouseDownBehavior behavior = element.GetValue(ItemClickCommandBehaviorProperty) as MouseDownBehavior;

            if (behavior == null)
            {
                behavior = new MouseDownBehavior(element);
                element.SetValue(ItemClickCommandBehaviorProperty, behavior);
            }

            return(behavior);
        }