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); } }
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); } }
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); } }
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); } }
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); } }
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); } }