Ejemplo n.º 1
0
        internal void OnItemMouseUp(int selectedIndex)
        {
            var content = m_generator.ContainerFromIndex(selectedIndex) as CoolMenuItem;

            this.Behavior.ApplyMouseUpBehavior(selectedIndex, content);

            if (MenuItemClicked != null)
            {
                SelectedMenuItemArgs menuArgs = new SelectedMenuItemArgs(content, selectedIndex);
                MenuItemClicked(this, menuArgs);
            }
        }
Ejemplo n.º 2
0
        private void contentElement_MouseEnter(object sender, MouseEventArgs e)
        {
            FrameworkElement r = sender as FrameworkElement;
            int index          = (int)r.Tag;

            AdjustSizes(index);

            if (MenuIndexChanged != null)
            {
                SelectedMenuItemArgs args = new SelectedMenuItemArgs(this.Items[index], index);
                MenuIndexChanged(this, args);
            }
        }
Ejemplo n.º 3
0
        private void contentElement_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            FrameworkElement selectedItem = (FrameworkElement)sender;

            if (this.MenuItemClickEffect == ClickEffect.Bounce)
            {
                ApplyBounceEffect(selectedItem);
            }

            if (MenuItemClicked != null)
            {
                int index = (int)selectedItem.Tag;
                SelectedMenuItemArgs menuArgs = new SelectedMenuItemArgs(this.Items[index], index);
                MenuItemClicked(this, menuArgs);
            }
        }
Ejemplo n.º 4
0
        internal void OnMouseEnter(int selectedIndex)
        {
            for (int i = 0; i < this.Items.Count; ++i)
            {
                var content = m_generator.ContainerFromIndex(i) as CoolMenuItem;

                // No items selected.
                if (selectedIndex == -1)
                {
                    this.Behavior.ApplyMouseEnterBehavior(-1, content);
                    continue;
                }

                this.Behavior.ApplyMouseEnterBehavior(Math.Abs(i - selectedIndex), content);
            }

            if (MenuIndexChanged != null && selectedIndex != -1)
            {
                var content = m_generator.ContainerFromIndex(selectedIndex) as CoolMenuItem;
                SelectedMenuItemArgs menuArgs = new SelectedMenuItemArgs(content, selectedIndex);
                MenuIndexChanged(this, menuArgs);
            }
        }
Ejemplo n.º 5
0
        internal void OnMouseEnter(int selectedIndex)
        {
            for (int i = 0; i < this.Items.Count; ++i)
            {
                var content = m_generator.ContainerFromIndex(i) as CoolMenuItem;

                // No items selected.
                if (selectedIndex == -1)
                {
                    this.Behavior.ApplyMouseEnterBehavior(-1, content);
                    continue;
                }

                this.Behavior.ApplyMouseEnterBehavior(Math.Abs(i - selectedIndex), content);
            }

            if (MenuIndexChanged != null && selectedIndex != -1)
            {
                var content = m_generator.ContainerFromIndex(selectedIndex) as CoolMenuItem;
                SelectedMenuItemArgs menuArgs = new SelectedMenuItemArgs(content, selectedIndex);
                MenuIndexChanged(this, menuArgs);
            }
        }
Ejemplo n.º 6
0
        internal void OnItemMouseUp(int selectedIndex)
        {
            var content = m_generator.ContainerFromIndex(selectedIndex) as CoolMenuItem;
            this.Behavior.ApplyMouseUpBehavior(selectedIndex, content);

            if (MenuItemClicked != null)
            {
                SelectedMenuItemArgs menuArgs = new SelectedMenuItemArgs(content, selectedIndex);
                MenuItemClicked(this, menuArgs);
            }
        }
Ejemplo n.º 7
0
        private void contentElement_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            FrameworkElement selectedItem = (FrameworkElement)sender;

            if(this.MenuItemClickEffect == ClickEffect.Bounce)
                ApplyBounceEffect(selectedItem);

            if(MenuItemClicked != null)
            {
                int index = (int)selectedItem.Tag;
                SelectedMenuItemArgs menuArgs = new SelectedMenuItemArgs(this.Items[index], index);
                MenuItemClicked(this, menuArgs);
            }
        }
Ejemplo n.º 8
0
        private void contentElement_MouseEnter(object sender, MouseEventArgs e)
        {
            FrameworkElement r = sender as FrameworkElement;
            int index = (int) r.Tag;
            AdjustSizes(index);

            if(MenuIndexChanged != null)
            {
                SelectedMenuItemArgs args = new SelectedMenuItemArgs(this.Items[index], index);
                MenuIndexChanged(this, args);
            }
        }