protected override void OnKeyDown(KeyEventArgs e) { this.OnKeyDownNavigate(e); base.OnKeyDown(e); if (!e.Handled) { switch (e.Key) { case Key.Up: case Key.Down: if (MenuRibbon != null && MenuRibbon.RibbonDisplay == RibbonDisplay.Drop) { var c = MenuRibbon.DroppedRibbonItem.Content.FirstFocusableElement(); if (c == null) { var p = MenuRibbon.VisualChildren().Where(x => (string)x.GetValue(FrameworkElement.NameProperty) == "PART_Popup").FirstOrDefault() as Popup; if (p != null) { c = p.Child.FirstFocusableElement(); } } if (c != null) { c.Focus(); e.Handled = true; } } break; } } }
void OnClicks(Tuple <MouseButtonEventArgs, int> x) { if (MenuRibbon != null && x.Item2 % 2 == 0) { MenuRibbon.TogglePin(); } }
private void UpdateMenuRibbon() { var p = this.LogicalParent(); while (p is RibbonItem) p = p.LogicalParent(); MenuRibbon = p as MenuRibbon; }
private void UpdateMenuRibbon() { var p = this.LogicalParent(); while (p is RibbonItem) { p = p.LogicalParent(); } MenuRibbon = p as MenuRibbon; }
public TogglePinCmd(MenuRibbon ribbon) { this.ribbon = ribbon; }
void IPopupItem.Action() { MenuRibbon.TogglePin(); }