/// <summary>
        /// Called when [set command callback].
        /// </summary>
        /// <param name="dependencyObject">The dependency object.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void OnSetCommandCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            RibbonTab element = dependencyObject as RibbonTab;

            if (element != null)
            {
                MouseDownBehavior behavior = GetOrCreateBehavior(element);
                behavior.Command = e.NewValue as ICommand;
            }
        }
        /// <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);
        }
 /// <summary>
 /// Sets the item click command behavior.
 /// </summary>
 /// <param name="obj">The obj.</param>
 /// <param name="value">The value.</param>
 public static void SetItemClickCommandBehavior(DependencyObject obj, MouseDownBehavior value)
 {
     obj.SetValue(ItemClickCommandBehaviorProperty, value);
 }