void CoolMenuItem_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            CoolMenu cm    = this.ParentItemsControl as CoolMenu;
            int      index = CoolMenu.GetGenerator(cm).IndexFromContainer(this);

            cm.OnItemMouseLeave(index);
        }
예제 #2
0
        private static void OnItemContainerStylePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            CoolMenu c         = d as CoolMenu;
            Style    value     = e.NewValue as Style;
            var      generator = CoolMenu.GetGenerator(c);

            generator.UpdateItemContainerStyle(value);
        }
예제 #3
0
        internal static CoolMenuItemContainerGenerator GetGenerator(ItemsControl control)
        {
            CoolMenu menu = control as CoolMenu;

            if (menu != null)
            {
                return(menu.m_generator);
            }
            return(null);
        }
 /// <summary>
 /// Initializes each element in the cool menu.
 /// </summary>
 /// <param name="parent">The parent CoolMenu.</param>
 /// <param name="element">The element of concern.</param>
 public virtual void Initialize(CoolMenu parent, CoolMenuItem element)
 {
     element.Height = MaxItemHeight * m_sizes[m_sizes.Length -1];
     element.Width = MaxItemWidth * m_sizes[m_sizes.Length - 1];
 }
예제 #5
0
 /// <summary>
 /// Initializes each element in the cool menu.
 /// </summary>
 /// <param name="parent">The parent CoolMenu.</param>
 /// <param name="element">The element of concern.</param>
 public virtual void Initialize(CoolMenu parent, CoolMenuItem element)
 {
     element.Height = MaxItemHeight * m_sizes[m_sizes.Length - 1];
     element.Width  = MaxItemWidth * m_sizes[m_sizes.Length - 1];
 }
 public override void Initialize(CoolMenu parent, CoolMenuItem element)
 {
     base.Initialize(parent, element);
     element.Background = new SolidColorBrush(Colors.Yellow);
 }